"java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal" error when using SUM in JBEDS

Solution Verified - Updated -

Issue

  • I am executing a query containing a SUM function in JBEDS, all the columns in the SUM are BigDecimal but the following exception is thrown:
2012-08-08 11:52:17,947 ERROR [org.teiid.PROCESSOR] (Worker6_QueryProcessorQueue93) Unexpected exception for request 1dWoYS9o4eXp.4
java.lang.ClassCastException: java.lang.String cannot be cast to java.math.BigDecimal
        at org.teiid.query.function.aggregate.Sum.addInputDirect(Sum.java:122)
        at org.teiid.query.function.aggregate.AggregateFunction.addInput(AggregateFunction.java:67)
        at org.teiid.query.processor.relational.GroupingNode.updateAggregates(GroupingNode.java:421)
        at org.teiid.query.processor.relational.GroupingNode.groupPhase(GroupingNode.java:372)
        at org.teiid.query.processor.relational.GroupingNode.nextBatchDirect(GroupingNode.java:270)
        at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:275)
        at org.teiid.query.processor.relational.LimitNode.nextBatchDirect(LimitNode.java:100)
        at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:275)
        at org.teiid.query.processor.relational.ProjectNode.nextBatchDirect(ProjectNode.java:162)
        at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:275)
        at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:162)
        at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:139)
        at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:105)
        at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:147)
        at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:360)
        at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:282)
        at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:49)
        at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:210)
        at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:238)
        at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:122)
        at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:292)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)

Environment

  • JBoss Enterprise Data Services (JBEDS) 5.2

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In