Skip to content

Commit 7923e9c

Browse files
committed
Simplify
1 parent 0cc5ba2 commit 7923e9c

File tree

1 file changed

+2
-3
lines changed
  • datafusion/physical-plan/src/repartition

1 file changed

+2
-3
lines changed

datafusion/physical-plan/src/repartition/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl RepartitionExecState {
382382
txs,
383383
partitioning.clone(),
384384
metrics,
385-
// preserve_order depends on input partition to start from 0
385+
// preserve_order depends on partition index to start from 0
386386
if preserve_order { 0 } else { i },
387387
num_input_partitions,
388388
));
@@ -443,8 +443,7 @@ impl BatchPartitioner {
443443
num_partitions,
444444
// Distribute starting index evenly based on input partition, number of input partitions and number of partitions
445445
// to avoid they all start at partition 0 and heavily skew on the lower partitions
446-
next_idx: ((input_partition * num_partitions) / num_input_partitions)
447-
% num_partitions,
446+
next_idx: ((input_partition * num_partitions) / num_input_partitions),
448447
}
449448
}
450449
Partitioning::Hash(exprs, num_partitions) => BatchPartitionerState::Hash {

0 commit comments

Comments
 (0)