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

Support multiple columns in PARTITION BY clause of window function

    Details

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

      Description

      When I add multiple partition columns to a window function:

        @Test public void testSelect() throws SQLException {
          checkSql("model", "select NAME,DEPTNO,count(*) over (partition by NAME,DEPTNO) from EMPS");
        }
      
      

      Following exception is thrown:

      java.sql.SQLException: Error while executing SQL "select NAME,DEPTNO,count(*) over (partition by NAME,DEPTNO) from EMPS": Error while compiling generated Java code:
      

      However the document from calcite.apache.org/docs/reference.html states multiple partition columns should be allowed:

      windowSpec:
            [ windowName ]
            '('
            [ ORDER BY orderItem [, orderItem ]* ]
            [ PARTITION BY expression [, expression ]* ]
            [
                RANGE numericOrIntervalExpression { PRECEDING | FOLLOWING }
            |   ROWS numericExpression { PRECEDING | FOLLOWING }
            ]
            ')'
      
      

      After searching it seems no one is reporting the same issue. I'm opening this JIAR as a placeholder, will try to fix this issue

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                julianhyde Julian Hyde
                Reporter:
                mahongbin hongbin ma
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: