Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Resolved
-
1.34.0
-
None
Description
Usually, it is not valid to specify multiple ORDER BY columns with RANGE bounds in window functions:
SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN 3 preceding and 4 following) from t;
However, it is valid if both bounds are "constant" bound (CURRENT ROW, UNBOUNDED PRECEDING and UNBOUNDED FOLLOWING), i.e:
SELECT sum(x) OVER (ORDER BY x,y RANGE BETWEEN UNBOUNDED PRECEDING and CURRENT ROW) from t;
(tested on PostgreSQL and SQL Server)
Calcite will incorrectly reject it.
Attachments
Issue Links
- links to