You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2024/08/19 22:58:00 UTC

[jira] [Created] (CALCITE-6538) OVER (ROWS CURRENT ROW) should return a window with one row, not all rows

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)