NoahKusaba opened a new issue, #2957:
URL: https://github.com/apache/datafusion-ballista/issues/2957
**Describe the bug**
With the static planner, this window query fails at runtime:
```
Task failed due to runtime execution error:
DataFusionError(Shared(Internal("Assertion failed:
window_expr[0].partition_by().len() == ordered_partition_by_indices.len()
(left: 1, right: 0): All partition by columns should have an ordering")))
```
DataFusion and the adaptive planner run it.
**To Reproduce**
Standalone Ballista on `main` (446fa54c9), static planner (default), default
settings otherwise. `aggregate_test_100` is the CSV table from #2951
(`testing/data/csv/aggregate_test_100.csv`).
```sql
SELECT
SUM(c5) OVER (ORDER BY c4 RANGE BETWEEN 3 PRECEDING AND 1 FOLLOWING) AS
summation2,
SUM(c4) OVER (ORDER BY c3 RANGE 3 PRECEDING) AS summation3,
SUM(c4) OVER (ORDER BY c5 RANGE BETWEEN UNBOUNDED PRECEDING AND UNBOUNDED
FOLLOWING) AS summation6,
SUM(c4) OVER (ORDER BY c5 RANGE UNBOUNDED PRECEDING) AS summation7,
SUM(c2) OVER (PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED
PRECEDING AND UNBOUNDED FOLLOWING) AS summation10,
SUM(c4) OVER (PARTITION BY c1 ORDER BY c5 RANGE UNBOUNDED PRECEDING) AS
summation11,
SUM(c2) OVER (PARTITION BY c1 ORDER BY c5 RANGE BETWEEN UNBOUNDED
PRECEDING AND UNBOUNDED FOLLOWING) AS summation14,
SUM(c4) OVER (PARTITION BY c5 ORDER BY c5 RANGE UNBOUNDED PRECEDING) AS
summation15,
SUM(c2) OVER (PARTITION BY c5, c7, c9 ORDER BY c5 RANGE BETWEEN UNBOUNDED
PRECEDING AND UNBOUNDED FOLLOWING) AS summation20,
SUM(c2) OVER (PARTITION BY c5 ORDER BY c5 RANGE BETWEEN UNBOUNDED
PRECEDING AND UNBOUNDED FOLLOWING) AS summation21
FROM aggregate_test_100
ORDER BY c9
LIMIT 2;
```
**Expected behavior**
```
61035129 | -38183 | 231997 | 145307 | 4 | -9603 | 63 | -16110 | 4 | 4
-108973366 | -2906 | 231997 | 131173 | 2 | 150222 | 44 | 3917 | 2 | 2
```
**Additional context**
Found by running DataFusion's sqllogictest files on Ballista (#2945):
`pg_compat/pg_compat_window.slt:1029`. The assertion is in DataFusion's window
operators (`BoundedWindowAggExec` / `WindowAggExec`). It fires when a window
node's input doesn't have the ordering the node was planned with, so the static
planner's stage split may be dropping an ordering.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]