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

Unexpected upper-casing of keywords when using java lexer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Optiq capitalizes some of the column names for unknown reason when using java lexer.
      The capitalization is not consistent when comparing `select *...` with `select column...`
      The error message is not clear enough to understand if we have to quote column name due to clash with keyword.

      Problem is reproducible in 0.4.18 and 0.4.19-SNAPSHOT (4530bc2)

      I add empTable.addColumn("path", varchar10Type) in MockCatalogReader, then run some tests:

      select path from EMP
      Parse tree: SELECT `PATH`\nFROM `EMP`

      Note that PATH is capitalized for no reason. The query fails with

      java.lang.AssertionError: Validator threw unexpected exception; query [select path from EMP];
      exception [Column 'PATH' not found in any table]; pos [line 1 col 8 thru line 1 col 8]

      This one works fine:

      select `path` from EMP
      Parse tree: SELECT \`path\`\nFROM \`EMP\`

      This one fails:

      select path from (select `path` from EMP);
      exception [Column 'PATH' not found in any table]; pos [line 1 col 8 thru line 1 col 8]

      This one works:

      select path from (select `path` path from EMP)

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/145
      Created by: vlsi
      Labels:
      Created at: Thu Feb 20 19:05:28 CET 2014
      State: closed

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: