leaves12138 opened a new pull request, #7737:
URL: https://github.com/apache/paimon/pull/7737

   ## Summary
   
   Fix a bug in `PostponeFixedBucketChannelComputer` where all records in the 
same partition are routed to the same downstream channel in batch mode, causing 
only one subtask to actually process data.
   
   ## Root Cause
   
   In the `channel()` method, the variable `bucket` was set to the total number 
of buckets for the partition (from `knownNumBuckets`). Since this value is the 
same for all records in the same partition, `ChannelComputer.select(partition, 
bucket, numChannels)` always returns the same channel — all records go to one 
subtask.
   
   ## Fix
   
   Compute a per-record bucket by hashing the `trimmedPrimaryKey` and taking 
modulo `numBuckets`. This distributes records with different primary keys 
across different channels/subtasks, similar to how 
`ChannelComputer.startChannel` handles `Integer.MIN_VALUE`.
   
   ## Testing
   
   Verified the logic matches the pattern used in `RowDataChannelComputer` 
(fixed bucket tables) and `PostponeBucketChannelComputer` (streaming postpone 
tables).


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