You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Tony Zhao (JIRA)" <ji...@apache.org> on 2017/05/10 22:54:04 UTC

[jira] [Created] (CALCITE-1785) aliases are being treated as keywords

Tony Zhao created CALCITE-1785:
----------------------------------

             Summary: aliases are being treated as keywords
                 Key: CALCITE-1785
                 URL: https://issues.apache.org/jira/browse/CALCITE-1785
             Project: Calcite
          Issue Type: Bug
    Affects Versions: 1.12.0
            Reporter: Tony Zhao
            Assignee: Julian Hyde


I tried both version 1.11.0 and 1.12.0, this is the scala code to reproduce the bug
{code}
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()
{code}
gives
{code}
org.apache.calcite.sql.parser.SqlParseException: Encountered ". value" at line 3, column 13.
{code}
This fails because value is in the keyword list, but it is actually an alias here and shouldn't be treated as a keyword.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)