You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by GitBox <gi...@apache.org> on 2022/03/04 01:34:01 UTC

[GitHub] [incubator-seatunnel] BenJFan commented on a change in pull request #1369: [Feature-1358][Connector] Clickhouse support split mode (#1358)

BenJFan commented on a change in pull request #1369:
URL: https://github.com/apache/incubator-seatunnel/pull/1369#discussion_r819198857



##########
File path: seatunnel-connectors/seatunnel-connector-spark-clickhouse/src/main/scala/org/apache/seatunnel/spark/sink/Clickhouse.scala
##########
@@ -16,37 +16,56 @@
  */
 package org.apache.seatunnel.spark.sink
 
-import java.math.BigDecimal
+import net.jpountz.xxhash.{XXHash64, XXHashFactory}

Review comment:
       When sharding key isn't a number, we need use hash to get which shard we should write.
   ``` scala
   val offset = (hashInstance.hash(ByteBuffer.wrap(row.getString(fieldIndex).getBytes), 0) & Long.MaxValue %
                   this.shardWeightCount).toInt
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org