2 Replies Latest reply on Nov 21, 2014 12:49 PM by shawkins

    java.lang.ClassCastException: org.teiid.query.sql.symbol.ExpressionSymbol cannot be cast to org.teiid.query.sql.symbol.ElementSymbol

    michal.warecki

      Hi guys,

       

      With a query with custom function I'm getting ClassCastException. What is important: it works if ExecutionFactory support group by. If it doesn't support group by then the following stack trace is generated:

       

      SEVERE: TEIID30019 Unexpected exception for request 2xYx/4EuyTPF.0

      java.lang.ClassCastException: org.teiid.query.sql.symbol.ExpressionSymbol cannot be cast to org.teiid.query.sql.symbol.ElementSymbol

        at org.teiid.query.processor.relational.GroupingNode.initialize(GroupingNode.java:201)

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

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

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

        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:449)

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

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

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

        at org.teiid.dqp.internal.process.DQPCore.executeRequest(DQPCore.java:297)

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

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.teiid.transport.LocalServerConnection$1$1.call(LocalServerConnection.java:173)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

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

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

        at org.teiid.transport.LocalServerConnection$1.invoke(LocalServerConnection.java:171)

        at com.sun.proxy.$Proxy69.executeRequest(Unknown Source)

        at org.teiid.jdbc.StatementImpl.execute(StatementImpl.java:634)

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

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

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

        at com.rbsfm.foundry.sql.jdbc.rowsource.RowSourceConnection.createLocalPagingIterator(RowSourceConnection.java:128)

        at com.rbsfm.foundry.sql.jdbc.rowsource.RowSourceConnection.execute(RowSourceConnection.java:101)

        at com.rbsfm.foundry.sql.jdbc.server.FoundryConnection.wrappedExecute(FoundryConnection.java:35)

        at com.rbsfm.foundry.sql.jdbc.server.FoundryResultSetExecution.execute(FoundryResultSetExecution.java:52)

        at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:327)

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

        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

        at java.lang.reflect.Method.invoke(Method.java:597)

        at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:209)

        at com.sun.proxy.$Proxy94.execute(Unknown Source)

        at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:298)

        at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:110)

        at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:107)

        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)

        at java.util.concurrent.FutureTask.run(FutureTask.java:138)

        at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:58)

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

        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$Worker.runTask(ThreadPoolExecutor.java:895)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)

        at java.lang.Thread.run(Thread.java:662)

       

      Version: 8.9.0.Final

       

      Query:

       

      SELECT

         sometable."AAA",

         custom_function(sometable."BBB", 'aaa', 'bbb', '2014-01-19', 'ccc'),

         SUM(sometable."Value")

      FROM sometable

      WHERE

         sometable."NS" = 'ns1'

         AND sometable."Date" = {d '2014-01-18'}

      GROUP BY sometable."AAA", sometable."BBB"

       

      In debug I see that this org.teiid.query.sql.symbol.ExpressionSymbol is a custom_function().

      Am I doing something wrong or this is a bug?

       

      I see that this is similar issue to class cast error . Let me know if you need