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
34 changes: 34 additions & 0 deletions datafusion/sqllogictest/test_files/window.slt
Original file line number Diff line number Diff line change
Expand Up @@ -8222,6 +8222,40 @@ SELECT count(DISTINCT b) FROM (
----
7

# https://github.com/apache/datafusion/issues/26626
query II
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

statement ok
set datafusion.execution.target_partitions = 4;

query II
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

statement ok
set datafusion.optimizer.repartition_windows = false;

query II
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

statement ok
reset datafusion.optimizer.repartition_windows;

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