[ 
https://issues.apache.org/jira/browse/CALCITE-1785?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julian Hyde resolved CALCITE-1785.
----------------------------------
    Resolution: Invalid

Java won't let you create a member variable called "if", because "if" is 
reserved in Java. "VALUE" is the same in SQL. It is reserved, which is stronger 
than a regular keyword. You can't use it anywhere.

Marking this case invalid.

> 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)

Reply via email to