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

aliases are being treated as keywords

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

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

      Description

      I tried both version 1.11.0 and 1.12.0, this is the scala code to reproduce the bug

      import org.apache.calcite.sql.parser.SqlParser
      val sqlStmt = """
      select distinct foo as bar,
      split_part(f.value, '-', -1) as state_code
      from sample_table a, table(flatten(a.location_slugs))
      """
      SqlParser.create(sqlStmt).parseQuery()
      

      gives

      org.apache.calcite.sql.parser.SqlParseException: Encountered ". value" at line 3, column 13.
      

      This fails because value is in the keyword list, but it is actually an alias here and shouldn't be treated as a keyword.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              touchdown Tony Zhao

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment