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

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

Xurenhe created CALCITE-5029:
--------------------------------

             Summary: 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


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)