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.

        Activity

        Show
        seanhychu Sean Hsuan-Yi Chu added a comment - https://github.com/apache/incubator-calcite/pull/101
        Hide
        seanhychu Sean Hsuan-Yi Chu added a comment -

        Julian Hyde Can you help for review?

        Show
        seanhychu Sean Hsuan-Yi Chu added a comment - Julian Hyde Can you help for review?
        Hide
        julianhyde Julian Hyde added a comment -
        Show
        julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/e51f853f . Thanks for the pull request, Sean!
        Hide
        jnadeau Jacques Nadeau added a comment -

        Resolved in release 1.4.0-incubating (2015-08-23)

        Show
        jnadeau Jacques Nadeau added a comment - Resolved in release 1.4.0-incubating (2015-08-23)

          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:

              Development