Skip to content

Commit 0cc5ba2

Browse files
committed
Simplify
1 parent 6165887 commit 0cc5ba2

File tree

1 file changed

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

1 file changed

+1
-3
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +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 as f64
447-
* (num_partitions as f64 / num_input_partitions as f64))
448-
as usize
446+
next_idx: ((input_partition * num_partitions) / num_input_partitions)
449447
% num_partitions,
450448
}
451449
}

0 commit comments

Comments
 (0)