You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "nsivabalan (via GitHub)" <gi...@apache.org> on 2026/06/25 03:09:38 UTC

Re: [I] BucketIndexPartitioner maybe cause task data skew [hudi]

nsivabalan commented on issue #15741:
URL: https://github.com/apache/hudi/issues/15741#issuecomment-4795470208

   This appears to be already fixed on `master`. The buggy `(partitionPath + curBucket).hashCode() % numPartitions` formula is no longer used in [`BucketIndexPartitioner#partition`](https://github.com/apache/hudi/blob/master/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/BucketIndexPartitioner.java#L51-L58); it now delegates to [`BucketIndexUtil.getPartitionIndexFunc`](https://github.com/apache/hudi/blob/master/hudi-common/src/main/java/org/apache/hudi/common/util/hash/BucketIndexUtil.java#L58-L67), which distributes a partition's buckets round-robin across tasks via `(partition.hashCode() % parallelism * bucketNum + curBucket) % parallelism`.
   
   Fix history:
   - HUDI-5671 / #7815 — original skew fix for `BucketIndexPartitioner`
   - HUDI-7957 / #11578 — extended the fix to bulk_insert + bucket_index
   - HUDI-7977 / #11608 — further algorithm improvement
   - HUDI-9329 / #13189 — int-overflow safety in `BucketIndexUtil`
   
   Closing as resolved unless you see the skew on a recent build — if so, please share the Hudi version and a small repro.


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