Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion/physical-plan/src/windows/window_agg_exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl ExecutionPlan for WindowAggExec {
ChildrenPropertiesMode::Recompute => Ok(Arc::new(WindowAggExec::try_new(
self.window_expr.clone(),
children.swap_remove(0),
true,
self.can_repartition,
)?)),
}
}
Expand Down
11 changes: 11 additions & 0 deletions datafusion/sqllogictest/test_files/window.slt
Original file line number Diff line number Diff line change
Expand Up @@ -8222,6 +8222,17 @@ SELECT count(DISTINCT b) FROM (
----
7

# With `target_partitions = 1`, a `WindowAggExec` whose children are replaced
# keeps requiring a single partition, so the plan passes the sanity check.
# https://github.com/apache/datafusion/issues/26626
query II rowsort
SELECT count(*) OVER (PARTITION BY a + NULL) AS x,
count(*) OVER (PARTITION BY a) AS y
FROM (SELECT 1 AS a UNION ALL SELECT 2);
----
2 1
2 1

# The SLT runner sets `target_partitions` to 4 instead of using the default, so
# restore that value rather than resetting.
statement ok
Expand Down