You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/05/16 13:12:10 UTC

[GitHub] [hudi] danny0405 commented on a diff in pull request #5590: [HUDI-4101] BucketIndexPartitioner should take partition path for bet…

danny0405 commented on code in PR #5590:
URL: https://github.com/apache/hudi/pull/5590#discussion_r873708869


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/BucketIndexPartitioner.java:
##########
@@ -39,8 +40,9 @@ public BucketIndexPartitioner(int bucketNum, String indexKeyFields) {
   }
 
   @Override
-  public int partition(String key, int numPartitions) {
+  public int partition(HoodieKey key, int numPartitions) {
     int curBucket = BucketIdentifier.getBucketId(key, indexKeyFields, bucketNum);
-    return BucketIdentifier.mod(curBucket, numPartitions);
+    int globalHash = (key.getPartitionPath() + curBucket).hashCode();

Review Comment:
   Cool, thanks for the review :)



-- 
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@hudi.apache.org

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