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

IndexOutOfBoundsException in ROLLUP query on JDBC data source

    Details

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

      Description

      IndexOutOfBoundsException in ROLLUP query.

      > select grouping(deptno), deptno, grouping(job), job, count(*) as c from "scott".emp group by rollup (deptno, job);
      Error: error while executing SQL "select grouping(deptno), deptno, grouping(job), job, count(*) as c from "scott".emp group by rollup (deptno, job)": Index: 3, Size: 3 (state=,code=0)
      java.sql.SQLException: error while executing SQL "select grouping(deptno), deptno, grouping(job), job, count(*) as c from "scott".emp group by rollup (deptno, job)": Index: 3, Size: 3
      	at org.apache.calcite.avatica.Helper.createException(Helper.java:41)
      	at org.apache.calcite.avatica.AvaticaStatement.executeInternal(AvaticaStatement.java:112)
      	at org.apache.calcite.avatica.AvaticaStatement.execute(AvaticaStatement.java:121)
      	at sqlline.Commands.execute(Commands.java:822)
      	at sqlline.Commands.sql(Commands.java:732)
      	at sqlline.SqlLine.dispatch(SqlLine.java:807)
      	at sqlline.SqlLine.begin(SqlLine.java:681)
      	at sqlline.SqlLine.start(SqlLine.java:398)
      	at sqlline.SqlLine.main(SqlLine.java:292)
      Caused by: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
      	at java.util.ArrayList.rangeCheck(ArrayList.java:635)
      	at java.util.ArrayList.get(ArrayList.java:411)
      	at org.apache.calcite.sql.SqlNodeList.get(SqlNodeList.java:92)
      	at org.apache.calcite.adapter.jdbc.JdbcImplementor$Result$1.field(JdbcImplementor.java:416)

        Issue Links

          Activity

          Hide
          julianhyde Julian Hyde added a comment -

          I have added a model to reproduce this issue: https://github.com/julianhyde/incubator-calcite/tree/729-jdbc-rollup.

          Show
          julianhyde Julian Hyde added a comment - I have added a model to reproduce this issue: https://github.com/julianhyde/incubator-calcite/tree/729-jdbc-rollup .
          Hide
          julianhyde Julian Hyde added a comment -
          Show
          julianhyde Julian Hyde added a comment - Model is checked into master as of http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/ee68f833 .
          Hide
          julianhyde Julian Hyde added a comment -

          Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/bf423761.

          This fix prevents us pushing down GROUPING SETS. I've added CALCITE-734 to push them down if the provider supports the syntax.

          Show
          julianhyde Julian Hyde added a comment - Fixed in http://git-wip-us.apache.org/repos/asf/incubator-calcite/commit/bf423761 . This fix prevents us pushing down GROUPING SETS. I've added CALCITE-734 to push them down if the provider supports the syntax.
          Hide
          julianhyde Julian Hyde added a comment -

          Resolved in release 1.3.0-incubating (2015-05-30).

          Show
          julianhyde Julian Hyde added a comment - Resolved in release 1.3.0-incubating (2015-05-30).

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              julianhyde Julian Hyde
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development