Skip to content

Commit 9af8b64

Browse files
committed
fix partition requirement
1 parent abb965a commit 9af8b64

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

datafusion/src/physical_plan/windows.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,15 @@ impl ExecutionPlan for WindowAggExec {
414414
}
415415

416416
fn required_child_distribution(&self) -> Distribution {
417-
Distribution::UnspecifiedDistribution
417+
if self
418+
.window_expr()
419+
.iter()
420+
.all(|expr| expr.partition_by().is_empty())
421+
{
422+
Distribution::SinglePartition
423+
} else {
424+
Distribution::UnspecifiedDistribution
425+
}
418426
}
419427

420428
fn with_new_children(

0 commit comments

Comments
 (0)