4 Replies Latest reply on Jan 25, 2018 1:20 PM by shawkins

    TeiidSQLException: ASSERTION FAILED: expected reference to be not null

    kulbhushanc

      Hi,

       

      I am using Teiid admin api 9.1.3 and Wildfly 10.0.0.

       

      I am trying to execute query:

      SELECT case when agent_tin_id is null then 'Y' else 'N' end agent_tin_id  from (SELECT agent_tin_id from MySQL_Server.bitool.AGENT_DIM where agent_tin_id>100 except( SELECT agent_tin_id from MySQL_Server.bitool.AGENT_DIM where agent_tin_id=100)) a

       

      But it failed to execute, below is exception stack trace:

      ASSERTION FAILED: expected reference to be not nullorg.teiid.jdbc.TeiidSQLException: ASSERTION FAILED: expected reference to be not null

      at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)

      at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)

      at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:747)

      at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:65)

      at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:561)

      at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135)

      at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40)

      at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79)

      at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:285)

      at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:337)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.teiid.net.socket.SocketServerConnectionFactory$ShutdownHandler.invoke(SocketServerConnectionFactory.java:98)

      at com.sun.proxy.$Proxy1.read(Unknown Source)

      at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:427)

      at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:570)

      at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:423)

      at org.teiid.jdbc.StatementImpl.executeQuery(StatementImpl.java:354)

      at com.bitwise.mySql.WithTeiid.execute(WithTeiid.java:701)

      at com.bitwise.mySql.WithTeiid.executeSelect(WithTeiid.java:261)

      at com.bitwise.mySql.WithTeiid.main(WithTeiid.java:55)

      Caused by: org.teiid.core.TeiidException: ASSERTION FAILED: expected reference to be not null

      at org.teiid.client.ResultsMessage.setException(ResultsMessage.java:196)

      at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1117)

      at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:593)

      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:374)

      at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)

      at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:275)

      at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)

      at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)

      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

      at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.AssertionError: ASSERTION FAILED: expected reference to be not null

      at org.teiid.core.util.Assertion.failed(Assertion.java:73)

      at org.teiid.core.util.Assertion.isNotNull(Assertion.java:100)

      at org.teiid.core.util.Assertion.isNotNull(Assertion.java:92)

      at org.teiid.query.processor.relational.RelationalNode.getProjectionIndexes(RelationalNode.java:367)

      at org.teiid.query.processor.relational.JoinNode.initialize(JoinNode.java:133)

      at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:96)

      at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:102)

      at org.teiid.query.processor.relational.RelationalPlan.initialize(RelationalPlan.java:91)

      at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:226)

      at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:138)

      at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)

      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)

      at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)

      at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:477)

      at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:349)

      ... 8 more

       

       

      Thanks,

      Kulbhushan Chaskar

        • 2. Re: TeiidSQLException: ASSERTION FAILED: expected reference to be not null
          kulbhushanc

          In case of teiid-10.0.1 for query : "SELECT case when abc.agent_tin_id =10 then 'Y' else 'N' end as abc from (SELECT agent_tin_id from MySQL_Server.bitool.AGENT_DIM where agent_tin_id>100 except SELECT agent_tin_id from MySQL_Server.bitool.AGENT_DIM where agent_tin_id=100) as abc"

           

          it's throwing an exception...

          Stack Trace:

          Planning error. Could not find symbol: abc.AGENT_TIN_IDorg.teiid.jdbc.TeiidSQLException: Planning error. Could not find symbol: abc.AGENT_TIN_ID

          at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:135)

          at org.teiid.jdbc.TeiidSQLException.create(TeiidSQLException.java:71)

          at org.teiid.jdbc.StatementImpl.postReceiveResults(StatementImpl.java:747)

          at org.teiid.jdbc.StatementImpl.access$100(StatementImpl.java:65)

          at org.teiid.jdbc.StatementImpl$2.onCompletion(StatementImpl.java:561)

          at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135)

          at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40)

          at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79)

          at org.teiid.net.socket.SocketServerInstanceImpl.receivedMessage(SocketServerInstanceImpl.java:285)

          at org.teiid.net.socket.SocketServerInstanceImpl.read(SocketServerInstanceImpl.java:337)

          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

          at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

          at java.lang.reflect.Method.invoke(Unknown Source)

          at org.teiid.net.socket.SocketServerConnectionFactory$ShutdownHandler.invoke(SocketServerConnectionFactory.java:98)

          at com.sun.proxy.$Proxy1.read(Unknown Source)

          at org.teiid.net.socket.SocketServerInstanceImpl$RemoteInvocationHandler$1.get(SocketServerInstanceImpl.java:427)

          at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:570)

          at org.teiid.jdbc.StatementImpl.executeSql(StatementImpl.java:423)

          at org.teiid.jdbc.StatementImpl.executeQuery(StatementImpl.java:354)

          at com.bitwise.mySql.WithTeiid.execute(WithTeiid.java:699)

          at com.bitwise.mySql.WithTeiid.executeSelect(WithTeiid.java:259)

          at com.bitwise.mySql.WithTeiid.main(WithTeiid.java:55)

          Caused by: org.teiid.core.TeiidException: Planning error. Could not find symbol: abc.AGENT_TIN_ID

          at org.teiid.client.ResultsMessage.setException(ResultsMessage.java:192)

          at org.teiid.dqp.internal.process.RequestWorkItem.sendError(RequestWorkItem.java:1148)

          at org.teiid.dqp.internal.process.RequestWorkItem.close(RequestWorkItem.java:596)

          at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:375)

          at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)

          at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)

          at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)

          at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)

          at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)

          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

          at java.lang.Thread.run(Unknown Source)

          Caused by: org.teiid.core.TeiidRuntimeException: Planning error. Could not find symbol: abc.AGENT_TIN_ID

          at org.teiid.query.processor.relational.RelationalNode.getProjectionIndexes(RelationalNode.java:363)

          at org.teiid.query.processor.relational.JoinNode.initialize(JoinNode.java:129)

          at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:92)

          at org.teiid.query.processor.relational.RelationalPlan.connectExternal(RelationalPlan.java:98)

          at org.teiid.query.processor.relational.RelationalPlan.initialize(RelationalPlan.java:87)

          at org.teiid.query.processor.QueryProcessor.init(QueryProcessor.java:223)

          at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:135)

          at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:111)

          at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:160)

          at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:142)

          at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:480)

          at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:350)

          ... 8 more

          • 3. Re: TeiidSQLException: ASSERTION FAILED: expected reference to be not null
            shawkins

            Please log an issue - JBoss Issue Tracker

             

            If possible include the plan debug log as that will make it clear where a planning error may be occurring.

            • 4. Re: TeiidSQLException: ASSERTION FAILED: expected reference to be not null
              shawkins