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

Allow windowed aggregate on top of regular aggregate

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.3.0-incubating
    • 1.8.0
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: