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

SQL parse error if column named 'value'

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • 1.7.0
    • 1.8.0
    • None
    • None

    Description

      select t1.a, t2.b, `t2.value` from t1 left join t2 on t1.id=t2.id join (select a,b,c from t3) t4 on t2.id=t4.id where t2.b>100
      
      Exception in thread "main" org.apache.calcite.sql.parser.SqlParseException: Lexical error at line 1, column 20.  Encountered: "`" (96), after : ""
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:388)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:119)
      	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:131)
      	at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:156)
      	at org.apache.calcite.prepare.PlannerImpl.parse(PlannerImpl.java:167)
      	at com.fenbi.pipe.utils.SqlParserUtils.getDependTables(SqlParserUtils.java:77)
      	at com.fenbi.pipe.utils.SqlParserUtils.run(SqlParserUtils.java:72)
      	at com.fenbi.pipe.utils.SqlParserUtils.main(SqlParserUtils.java:111)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      Caused by: org.apache.calcite.sql.parser.impl.TokenMgrError: Lexical error at line 1, column 20.  Encountered: "`" (96), after : ""
      	at org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.getNextToken(SqlParserImplTokenManager.java:14038)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_scan_token(SqlParserImpl.java:17512)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_3_81(SqlParserImpl.java:11351)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_3R_114(SqlParserImpl.java:11343)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_3R_45(SqlParserImpl.java:11449)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_3_78(SqlParserImpl.java:11475)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_2_78(SqlParserImpl.java:6036)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.SelectList(SqlParserImpl.java:1340)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlSelect(SqlParserImpl.java:874)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.LeafQuery(SqlParserImpl.java:578)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.LeafQueryOrExpr(SqlParserImpl.java:2417)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.QueryOrExpr(SqlParserImpl.java:2336)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.OrderedQueryOrExpr(SqlParserImpl.java:496)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:805)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:831)
      	at org.apache.calcite.sql.parser.impl.SqlParserImpl.parseSqlStmtEof(SqlParserImpl.java:178)
      	at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:124)
      	... 10 more
      
      Process finished with exit code 1
      

      Attachments

        Activity

          People

            julianhyde Julian Hyde
            chenheng Heng Chen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: