Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5029

Babel parser support identifier starting with number

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.34.0
    • 1.35.0
    • babel

    Description

      MySQL support identifier starting with number, which is without any quoting.

      • test case
      @Test void testIdentifierStartWithNumber() {
      final String sql =
      "select 1_c1 from (select deptno as 1_c1 from emp)";
      sql(sql).ok();
      } 
      • Exception
      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) 

      As discuss of email's group: https://lists.apache.org/thread/yj905ht2t2gwnndgyw5ks8nh0nftlyoo

      We could support it in babel's parser.

      Attachments

        Issue Links

          Activity

            People

              wojustme Xurenhe
              wojustme Xurenhe
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m