Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-6538

OVER (ROWS CURRENT ROW) should return a window with one row, not all rows

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 1.38.0
    • 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

          Activity

            People

              Unassigned Unassigned
              julianhyde Julian Hyde
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: