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

Allow windowed aggregate on top of regular aggregate

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-incubating
    • Fix Version/s: 1.8.0
    • Component/s: None
    • Labels:
      None

      Description

      Window aggregate on top of a regular aggregate expression is a valid query but currently fails with a 'aggregate expression cannot be nested' error.

      SELECT avg(sum(sal)) over (partition by deptno) from emp group by deptno;
      
      SEVERE: org.apache.calcite.sql.validate.SqlValidatorException: Aggregate expressions cannot be nested
      

      We should allow one level nesting of aggregates under window aggregates, i.e. window_agg(regular_agg(args)) over window.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                amansinha100 Aman Sinha
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: