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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/bucket/BucketStreamWriteFunction.java:
##########
@@ -135,12 +136,10 @@ public void processElement(I i, ProcessFunction<I, 
Object>.Context context, Coll
 
   /**
    * Determine whether the current fileID belongs to the current task.
-   * (partition + curBucket) % numPartitions == this taskID belongs to this 
task.
+   * partitionIndex == this taskID belongs to this task.
    */
   public boolean isBucketToLoad(int bucketNumber, String partition) {
-    final int partitionIndex = (partition.hashCode() & Integer.MAX_VALUE) % 
parallelism;
-    int globalIndex = partitionIndex + bucketNumber;
-    return BucketIdentifier.mod(globalIndex, parallelism)  == taskID;

Review Comment:
   Nice catch, should be a long-term bug though.



-- 
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]

Reply via email to