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

aliases are being treated as keywords

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.12.0
    • 1.13.0
    • None
    • 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

            julianhyde Julian Hyde
            touchdown Tony Zhao
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: