Skip to content

Commit 8ca56a2

Browse files
committed
Always add round robin repartition for child sources
1 parent d3cfc45 commit 8ca56a2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

datafusion/core/src/physical_optimizer/enforce_distribution.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -836,7 +836,9 @@ fn add_roundrobin_on_top(
836836
n_target: usize,
837837
) -> Result<DistributionContext> {
838838
// Adding repartition is helpful:
839-
if input.plan.output_partitioning().partition_count() < n_target {
839+
if input.plan.output_partitioning().partition_count() < n_target
840+
|| input.plan.children().is_empty()
841+
{
840842
// When there is an existing ordering, we preserve ordering
841843
// during repartition. This will be un-done in the future
842844
// If any of the following conditions is true

0 commit comments

Comments
 (0)