Julian Hyde created CALCITE-6538:
------------------------------------

             Summary: OVER (ROWS CURRENT ROW) should return a window with one 
row, not all rows
                 Key: CALCITE-6538
                 URL: https://issues.apache.org/jira/browse/CALCITE-6538
             Project: Calcite
          Issue Type: Improvement
            Reporter: Julian Hyde


{{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{}}}:
{noformat}
# 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 {noformat}
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to