Repository navigation
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
> SELECT i,AVG(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
+---+-----------------------------------------------------------------------------------------+
| i | avg(t.v) ORDER BY [t.i ASC NULLS LAST] ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING |
+---+-----------------------------------------------------------------------------------------+
| 1 | 1.5 |
| 2 | 2.0 |
| 3 | NaN |
| 4 | NaN |
+---+-----------------------------------------------------------------------------------------+
Correct result
D SELECT i,AVG(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOLLOWING) FROM (VALUES(1,1),(2,2),(3,NULL),(4,NULL)) t(i,v);
┌───────┬──────────────────────────────────────────────────────────────────────┐
│ i │ avg(v) OVER (ORDER BY i ROWS BETWEEN CURRENT ROW AND UNBOUNDED FOL… │
│ int32 │ double │
├───────┼──────────────────────────────────────────────────────────────────────┤
│ 1 │ 1.5 │
│ 2 │ 2.0 │
│ 3 │ │
│ 4 │ │
└───────┴──────────────────────────────────────────────────────────────────────┘
To Reproduce
No response
Expected behavior
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Activity
feat: fix AVG sliding windows wrong results with NULLs (apache#22139)