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

org.apache.calcite.sql.parser.SqlParseException: Lexical error at line 1, column 13. Encountered: "`" (96), after : ""

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.17.0
    • Fix Version/s: None
    • Component/s: core, server
    • Labels:
      None

      Description

      Dear all, I use ServerParserTest test sql like as :

      INSERT INTO `test.db3.tb3` SELECT d * 2, e, g FROM test.db2.tb2 WHERE d < 3 UNION ALL (SELECT a * 2, b, c FROM test.db1.tb1)
      

      then occur Exception:

      java.lang.RuntimeException: Error while parsing SQL: INSERT INTO `test.db3.tb3` SELECT d * 2, e, g FROM test.db2.tb2 WHERE d < 3 UNION ALL (SELECT a * 2, b, c FROM test.db1.tb1)
      
      at org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.parseStmtAndHandleEx(SqlParserTest.java:8503)
      at org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.check(SqlParserTest.java:8488)
      at org.apache.calcite.sql.parser.SqlParserTest$Sql.ok(SqlParserTest.java:8686)
      at org.apache.calcite.sql.parser.SqlParserTest.testInsertKInto(SqlParserTest.java:3460)
      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:498)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
      at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
      at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
      at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
      at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
      at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
      Caused by: org.apache.calcite.sql.parser.SqlParseException: Lexical error at line 1, column 13. Encountered: "`" (96), after : ""
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.convertException(SqlParserImpl.java:354)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.normalizeException(SqlParserImpl.java:142)
      at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:156)
      at org.apache.calcite.sql.parser.SqlParser.parseStmt(SqlParser.java:181)
      at org.apache.calcite.sql.parser.SqlParserTest$TesterImpl.parseStmtAndHandleEx(SqlParserTest.java:8501)
      ... 25 more
      Caused by: org.apache.calcite.sql.parser.impl.TokenMgrError: Lexical error at line 1, column 13. Encountered: "`" (96), after : ""
      at org.apache.calcite.sql.parser.impl.SqlParserImplTokenManager.getNextToken(SqlParserImplTokenManager.java:15511)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_scan_token(SqlParserImpl.java:24830)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_3_416(SqlParserImpl.java:20325)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.jj_2_416(SqlParserImpl.java:10393)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.Identifier(SqlParserImpl.java:4405)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.CompoundIdentifier(SqlParserImpl.java:4503)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlInsert(SqlParserImpl.java:1195)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmt(SqlParserImpl.java:854)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.SqlStmtEof(SqlParserImpl.java:876)
      at org.apache.calcite.sql.parser.impl.SqlParserImpl.parseSqlStmtEof(SqlParserImpl.java:198)
      at org.apache.calcite.sql.parser.SqlParser.parseQuery(SqlParser.java:148)
      ... 27 more
      

      and use calcite-core model SqlParserTest also occur this error,  is parser not support or I config has error?

       thanks.

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              ambition ambition
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: