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

Window aggregates invalid error/error messages in some cases

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.9.0
    • Component/s: None
    • Labels:
      None

      Description

      Queries which fail (or fail with inconsistent errors)
      Q1:

      select count( * ) over () from emp group by deptno 
      AssertionError: star should have been expanded.
      

      Q2:

      SELECT sum(empno), max(empno) OVER (order by deptno) 
      FROM emp 
      GROUP BY empno 
      gives error: Expression 'DEPTNO' is not being grouped
      
      SELECT sum(empno), max(empno) OVER w 
      FROM emp 
      GROUP BY empno 
      WINDOW w as (order by deptno)
      gives no error:
      

      Q3:

      select cume_dist() over w , rank() 
      from emp 
      window w as (partition by deptno order by deptno)
      Assertion Error: Expression 'DEPTNO' is not being grouped
      instead of 
      Assertion Error: OVER clause is necessary for window functions
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                gparai Gautam Parai
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: