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

[jira] [Commented] (CALCITE-5029) Babel parser support identifier starting with number

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

xiong duan commented on CALCITE-5029:
-------------------------------------

[~wojustme] Hi. I am just curious about the SqlIdentifier only including number?

> Babel parser support identifier starting with number
> ----------------------------------------------------
>
>                 Key: CALCITE-5029
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5029
>             Project: Calcite
>          Issue Type: Improvement
>          Components: babel
>            Reporter: Xurenhe
>            Assignee: Xurenhe
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> MySQL support identifier starting with number, which is without any quoting.
>  * test case
> {code:java}
> @Test void testIdentifierStartWithNumber() {
> final String sql =
> "select 1_c1 from (select deptno as 1_c1 from emp)";
> sql(sql).ok();
> } {code}
>  * Exception
> {code:java}
> java.lang.RuntimeException:
> org.apache.calcite.sql.parser.SqlParseException: Encountered "1" at line 1,
> column 36.
> Was expecting one of:
> <QUOTED_STRING> ...
> <BRACKET_QUOTED_IDENTIFIER> ...
> <QUOTED_IDENTIFIER> ...
> <BACK_QUOTED_IDENTIFIER> ...
> <BIG_QUERY_BACK_QUOTED_IDENTIFIER> ...
> <HYPHENATED_IDENTIFIER> ...
> <IDENTIFIER> ...
> <UNICODE_QUOTED_IDENTIFIER> ...
> at
> org.apache.calcite.sql.parser.SqlParseException.writeReplace(SqlParseException.java:171) {code}
> ----
> As discuss of email's group: [https://lists.apache.org/thread/yj905ht2t2gwnndgyw5ks8nh0nftlyoo]
> We could support it in babel's parser.



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