Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
Description
OVER (ROWS CURRENT ROW) should return a window with one row, not all rows.
For example, in the following query (in winagg.iq) each sum_sal value should equal the sal value (and does on Postgres), but currently Calcite gives 8275.00:
# Current row select ename, sal, sum(sal) over (rows current row) as sum_sal from emp where job = 'MANAGER'; +-------+---------+---------+ | ENAME | SAL | SUM_SAL | +-------+---------+---------+ | BLAKE | 2850.00 | 8275.00 | | CLARK | 2450.00 | 8275.00 | | JONES | 2975.00 | 8275.00 | +-------+---------+---------+ (3 rows) !ok
Attachments
Issue Links
- blocks
-
CALCITE-6537 Add syntax to allow non-aggregated rows to be used in GROUPING SETS
- Open
- is duplicated by
-
CALCITE-5883 Calcite ignores ROWS window frames when there is no ORDER BY clause
- Closed
- is related to
-
CALCITE-3877 In RexWindow, make fields upperBound and lowerBound not-nullable
- Closed