This is an automated email from the ASF dual-hosted git repository.
dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git
The following commit(s) were added to refs/heads/master by this push:
new 8a9f392 [INLONG-2171] Fix the problem that partition computed is
negative when using distributed table of clickhouse (#2172)
8a9f392 is described below
commit 8a9f3929136341ffe147e01fdc89a9f72720bf94
Author: TianqiWan <[email protected]>
AuthorDate: Mon Jan 17 17:42:26 2022 +0800
[INLONG-2171] Fix the problem that partition computed is negative when
using distributed table of clickhouse (#2172)
Co-authored-by: tianqiwan <[email protected]>
---
.../inlong/sort/flink/clickhouse/partitioner/HashPartitioner.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/flink/clickhouse/partitioner/HashPartitioner.java
b/inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/flink/clickhouse/partitioner/HashPartitioner.java
index 6f78ced..650106b 100644
---
a/inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/flink/clickhouse/partitioner/HashPartitioner.java
+++
b/inlong-sort/sort-core/src/main/java/org/apache/inlong/sort/flink/clickhouse/partitioner/HashPartitioner.java
@@ -34,7 +34,7 @@ public class HashPartitioner implements ClickHousePartitioner
{
}
public int select(Tuple2<Boolean, Row> record, int numShards) {
- return Objects.hashCode(record.f1.getField(pos)) % numShards;
+ return Math.abs(Objects.hashCode(record.f1.getField(pos))) % numShards;
}
}