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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]