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

Window aggregates invalid error/error messages in some cases

    XMLWordPrintableJSON

Details

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

              julianhyde Julian Hyde
              gparai Gautam Parai
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: