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

Adding a table to the root schema causes breakage in OptiqPrepareImpl

    Details

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

      Description

      I tried an even simpler version of the optiq-csv example. I ended up not implementing my own Schema, just a table instead. When I add the table to the root schema and no longer prefix it with a schema name the SQL parsing breaks and I get a stack trace like below.

      My table is very simple, column A is a string and column B is an integer.
      Query:

      ```
      select A, SUM(B) from SAMPLE group by A
      ```

      I'll try to attach the source for my test case.

      ```
      java.lang.IndexOutOfBoundsException: Index: 2, Size: 2
      at java.util.ArrayList.rangeCheck(ArrayList.java:604)
      at java.util.ArrayList.get(ArrayList.java:382)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.getColumnMetaDataList(OptiqPrepareImpl.java:376)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare2_(OptiqPrepareImpl.java:330)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepare_(OptiqPrepareImpl.java:219)
      at net.hydromatic.optiq.prepare.OptiqPrepareImpl.prepareSql(OptiqPrepareImpl.java:189)
      at net.hydromatic.optiq.jdbc.OptiqStatement.parseQuery(OptiqStatement.java:404)
      at net.hydromatic.optiq.jdbc.OptiqStatement.executeQuery(OptiqStatement.java:80)
      at net.hydromatic.optiq.test.TableInRootSchemaTest.testAddingTableInRootSchema(TableInRootSchemaTest.java:57)
      ...
      ```

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/85
      Created by: knut-forkalsrud
      Labels:
      Created at: Thu Nov 21 09:08:46 CET 2013
      State: closed

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              github-import GitHub Import
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: