Skip to content

Commit

Permalink
[BUG][Connector-V2] Iceberg source lost data with parallelism option
Browse files Browse the repository at this point in the history
Add bit operation to prevent negative value.
  • Loading branch information
kangdw0x80 committed Oct 27, 2023
1 parent 9980aa4 commit 7c1dab4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected void refreshPendingSplits() {
private void addPendingSplits(Collection<IcebergFileScanTaskSplit> newSplits) {
int numReaders = context.currentParallelism();
for (IcebergFileScanTaskSplit newSplit : newSplits) {
int ownerReader = newSplit.splitId().hashCode() % numReaders;
int ownerReader = (newSplit.splitId().hashCode() & Integer.MAX_VALUE) % numReaders;
pendingSplits.computeIfAbsent(ownerReader, r -> new ArrayList<>()).add(newSplit);
log.info("Assigning {} to {} reader.", newSplit, ownerReader);
}
Expand Down

0 comments on commit 7c1dab4

Please sign in to comment.