xicm opened a new issue, #11288:
URL: https://github.com/apache/hudi/issues/11288

   **_Tips before filing an issue_**
   
   - Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)?
   
   - Join the mailing list to engage in conversations and get faster support at 
[email protected].
   
   - If you have triaged this as a bug, then file an 
[issue](https://issues.apache.org/jira/projects/HUDI/issues) directly.
   
   **Describe the problem you faced**
   
   https://github.com/apache/hudi/pull/7815 works well for a single partition 
sink.
   
   
https://github.com/apache/hudi/blob/bcc1f8de4d9d0ac8c3cf6c51bb0a802ef2bcee20/hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/sink/partitioner/BucketIndexPartitioner.java#L42-L48
   
   If we write two or more partition in a batch, the partitioner may cause data 
skew.
   
   For example, we set the write parallelism to 8, bucket num to 4, and we 
write two partitions in a batch.
   Suppose that the partition hash modulo parallelism is 1 and 2。
   
   partition1:  partitionIndex=1,  bucket_num = [0, 1, 2, 3]
   partition2:  partitionIndex=2,  bucket_num = [0, 1, 2, 3]
   
   The globalIndex for each bucket (int globalIndex = partitionIndex + 
curBucket;)
   partition1:  globalIndex  = [1, 2, 3, 4]
   partition2:  globalIndex  = [2, 3, 4, 5]
   
   then mod 8,
   partition1:  [1, 2, 3, 4]
   partition2:   [2, 3, 4, 5]
   
   The partition result will be [1, 2, 3, 4, 5],our parallelism is 8, but we 
get 5 buckets,  bucket 2 and bucket 3 will get two pieces of data.
   
   
   **To Reproduce**
   
   Steps to reproduce the behavior:
   
   1.
   2.
   3.
   4.
   
   **Expected behavior**
   
   A clear and concise description of what you expected to happen.
   
   **Environment Description**
   
   * Hudi version :
   
   * Spark version :
   
   * Hive version :
   
   * Hadoop version :
   
   * Storage (HDFS/S3/GCS..) :
   
   * Running on Docker? (yes/no) :
   
   
   **Additional context**
   
   Add any other context about the problem here.
   
   **Stacktrace**
   
   ```Add the stacktrace of the error.```
   
   


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