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

When Group By clause is present, the argument in window function should not refer to any column outside Group By

    Details

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

      Description

      An invalid query such as:

      select max(empno) over () 
      from emp
      group by deptno
      

      This query is invalid because the argument in max (i.e., empno) points at a column which is not present in Group By clause. However, Calcite does not catch it but generate a plan.

      Invalid queries should fail early to reduce potential confusion.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              seanhychu Sean Hsuan-Yi Chu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: