You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2022/03/29 17:30:00 UTC

[jira] [Commented] (CALCITE-5067) Support using "LANGUAGE" as a variable name (like MySQL)

    [ https://issues.apache.org/jira/browse/CALCITE-5067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17514243#comment-17514243 ] 

Julian Hyde commented on CALCITE-5067:
--------------------------------------

Have you tried using the Babel parser? It has fewer reserved keywords.

> Support using "LANGUAGE" as a variable name (like MySQL)
> --------------------------------------------------------
>
>                 Key: CALCITE-5067
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5067
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Adolfo OchagavĂ­a
>            Priority: Minor
>
> In MySQL it is possible to use "LANGUAGE" as a variable name. The example below shows the difference between language (treated as a variable) and other keywords (which raise a syntax error):
> {code:java}
> mysql> SELECT LANGUAGE;
> ERROR 1054 (42S22): Unknown column 'LANGUAGE' in 'field list'
> mysql> SELECT ALTER;
> ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ALTER' at line 1{code}
> In other words, it would be great if the following code succeeded instead of throwing an exception:
> {code:java}
> var config = SqlParser.config().withLex(Lex.MYSQL);
> var parser = SqlParser.create("SELECT foo", config);
> var node = parser.parseQuery();{code}
> See, for context, [this thread|https://lists.apache.org/thread/lnln25csnbs9yqlskjq2pnqx3f1rdfw5].



--
This message was sent by Atlassian Jira
(v8.20.1#820001)