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

[jira] [Comment Edited] (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=17514260#comment-17514260 ] 

Adolfo Ochagavía edited comment on CALCITE-5067 at 3/29/22, 6:09 PM:
---------------------------------------------------------------------

Thanks for the suggestion, this is my first time working with Calcite and I am still finding my way around. The Babel parser worked out of the box! Is there any documentation about it? I would like to know if there are any noteworthy differences from the default parser, just to be sure I am not introducing unintended "features" with this change ;)


was (Author: JIRAUSER287229):
Thanks for the suggestion, this is my first time working with Calcite and I am still finding my way around. The Babel parser worked out of the box. Is there any documentation about it? I would like to know if there are any noteworthy differences from the default parser, just to be sure I am not introducing unintended "features" with this change ;)

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