Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-14163

SQL. Calcite: Error: Failed to plan query. (state=50000,code=1)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • None
    • sql
    • None
    • Docs Required, Release Notes Required

    Description

      Problem reproduced on inner , right,  right outer joins and unions, but not affected left\ left outer joins. 
      For test db creation please use create_env.txt.

      SELECT t17_1.int_col1, t17_2.int_col1, t17_1.id FROM t17_1 INNER JOIN t17_2 ON t17_1.id=t17_2.id WHERE t17_1.int_col2  IN(0,1,-2,3,-5,7,-11,13,-17,19,-23,29,-31,37,-41,43,-47,53,-59,61,-67,71,-73,79,-83,89,-97) OR t17_1.int_col1 > 10 ORDER BY t17_1.id;
      
      Error: Failed to plan query. (state=50000,code=1)
      java.sql.SQLException: Failed to plan query.
      	at org.apache.ignite.internal.jdbc.thin.JdbcThinConnection.sendRequest(JdbcThinConnection.java:1009)
      	at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute0(JdbcThinStatement.java:234)
      	at org.apache.ignite.internal.jdbc.thin.JdbcThinStatement.execute(JdbcThinStatement.java:560)
      	at sqlline.Commands.execute(Commands.java:823)
      	at sqlline.Commands.sql(Commands.java:733)
      	at sqlline.SqlLine.dispatch(SqlLine.java:795)
      	at sqlline.SqlLine.runCommands(SqlLine.java:1706)
      	at sqlline.Commands.run(Commands.java:1317)
      	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 sqlline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:38)
      	at sqlline.SqlLine.dispatch(SqlLine.java:791)
      	at sqlline.SqlLine.initArgs(SqlLine.java:595)
      	at sqlline.SqlLine.begin(SqlLine.java:643)
      	at sqlline.SqlLine.start(SqlLine.java:373)
      	at sqlline.SqlLine.main(SqlLine.java:265)
      

      Ignite log:

      [20:50:31,206][SEVERE][client-connector-#142][JdbcRequestHandler] Failed to execute SQL query [reqId=392, req=JdbcQueryExecuteRequest [schemaName=PUBLIC, pageSize=1024, maxRows=0, sqlQry=SELECT t17_1.int_col1, t17_2.int_col1, t17_1.id FROM t17_1 INNER JOIN t17_2 ON t17_1.id=t17_2.id WHERE t17_1.int_col1  IN(0,1,-2,3,-5,7,-11,13,-17,19,-23,29,-31,37,-41,43,-47,53,-59,61,-67,71,-73,79,-83,89,-97) OR t17_1.int_col1 > 10 ORDER BY t17_1.id, args=Object[] [], stmtType=ANY_STATEMENT_TYPE, autoCommit=true, partResReq=false, explicitTimeout=false, super=JdbcRequest [type=2, reqId=392]]]
      class org.apache.ignite.internal.processors.query.IgniteSQLException: Failed to plan query.
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareQuery(ExecutionServiceImpl.java:522)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.QueryPlanCacheImpl.queryPlan(QueryPlanCacheImpl.java:84)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.executeQuery(ExecutionServiceImpl.java:379)
      	at org.apache.ignite.internal.processors.query.calcite.CalciteQueryProcessor.query(CalciteQueryProcessor.java:248)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.querySqlFields(JdbcRequestHandler.java:790)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.executeQuery(JdbcRequestHandler.java:673)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.doHandle(JdbcRequestHandler.java:341)
      	at org.apache.ignite.internal.processors.odbc.jdbc.JdbcRequestHandler.handle(JdbcRequestHandler.java:278)
      	at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:202)
      	at org.apache.ignite.internal.processors.odbc.ClientListenerNioListener.onMessage(ClientListenerNioListener.java:56)
      	at org.apache.ignite.internal.util.nio.GridNioFilterChain$TailFilter.onMessageReceived(GridNioFilterChain.java:279)
      	at org.apache.ignite.internal.util.nio.GridNioFilterAdapter.proceedMessageReceived(GridNioFilterAdapter.java:109)
      	at org.apache.ignite.internal.util.nio.GridNioAsyncNotifyFilter$3.body(GridNioAsyncNotifyFilter.java:97)
      	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:120)
      	at org.apache.ignite.internal.util.worker.GridWorkerPool$1.run(GridWorkerPool.java:70)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.lang.UnsupportedOperationException: type not serializable: Sarg[(-∞..0), (0..+∞)] (type org.apache.calcite.util.Sarg)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJson.toJson(RelJson.java:291)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJson.toJson(RelJson.java:727)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJson.toJson(RelJson.java:766)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJson.toJson(RelJson.java:252)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:136)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explainInputs(RelJsonWriter.java:158)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.explain_(RelJsonWriter.java:139)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.done(RelJsonWriter.java:95)
      	at org.apache.calcite.rel.AbstractRelNode.explain(AbstractRelNode.java:246)
      	at org.apache.ignite.internal.processors.query.calcite.externalize.RelJsonWriter.toJson(RelJsonWriter.java:65)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.Fragment.<init>(Fragment.java:79)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.Fragment.<init>(Fragment.java:71)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.Splitter$FragmentProto.build(Splitter.java:119)
      	at org.apache.ignite.internal.processors.query.calcite.prepare.Splitter.go(Splitter.java:56)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareQuery(ExecutionServiceImpl.java:572)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareSingle(ExecutionServiceImpl.java:543)
      	at org.apache.ignite.internal.processors.query.calcite.exec.ExecutionServiceImpl.prepareQuery(ExecutionServiceImpl.java:502)
      	... 17 more
      

      Attachments

        1. caches.xml
          11 kB
          Fedor Malchikov
        2. create_env.txt
          114 kB
          Fedor Malchikov
        3. data-reg.xml
          5 kB
          Fedor Malchikov
        4. ignite.log
          134 kB
          Fedor Malchikov
        5. server.xml
          5 kB
          Fedor Malchikov
        6. sqlline.log
          284 kB
          Fedor Malchikov

        Issue Links

          Activity

            People

              korlov Konstantin Orlov
              prom1se Fedor Malchikov
              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 - 1h 20m
                  1h 20m