[
https://issues.jboss.org/browse/TEIID-4451?page=com.atlassian.jira.plugin...
]
Steven Hawkins updated TEIID-4451:
----------------------------------
Component/s: Query Engine
Fix Version/s: 9.1
9.0.5
This is a general issue with the conversion of a plan that calls a subquery repeatedly
into a semi-join plan. If the projection is an aggregate, then the parent plan isn't
finding the value.
Teradata translator - Unable to evaluate SUM(B.LongNum) in subquery
-------------------------------------------------------------------
Key: TEIID-4451
URL:
https://issues.jboss.org/browse/TEIID-4451
Project: Teiid
Issue Type: Bug
Components: Query Engine
Reporter: Juraj DurĂ¡ni
Assignee: Steven Hawkins
Fix For: 9.1, 9.0.5
Teiid throws exception \[2\] during evaluation of query \[1\] with teradata translator.
Similar issue with other functions, e.g. SUM, MIN.
{code:sql|title=\[1\] Query}
SELECT INTKEY, LONGNUM FROM BQT1.SMALLA AS A WHERE LONGNUM > (SELECT SUM(LONGNUM) FROM
BQT1.SMALLA AS B WHERE A.INTKEY = B.INTKEY) ORDER BY INTKEY
{code}
{code:plain|title=\[2\] Exception}
11:44:51,977 ERROR [org.teiid.PROCESSOR] (Worker3_QueryProcessorQueue51) TEIID30019
Unexpected exception for request t79rG4toMpAB.6: org.teiid.core.TeiidComponentException:
TEIID30328 Unable to evaluate SUM(B.LongNum): No value was available
at org.teiid.query.util.CommandContext.getFromContext(CommandContext.java:506)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.eval.Evaluator.internalEvaluate(Evaluator.java:718)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:693)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:362)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.eval.Evaluator.internalEvaluateTVL(Evaluator.java:237)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.eval.Evaluator.evaluateTVL(Evaluator.java:226)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.eval.Evaluator.evaluate(Evaluator.java:220)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.JoinNode.matchesCriteria(JoinNode.java:353)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.MergeJoinStrategy.process(MergeJoinStrategy.java:248)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.JoinNode.nextBatchDirect(JoinNode.java:227)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:282)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.BatchIterator.finalRow(BatchIterator.java:69)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.common.buffer.AbstractTupleSource.getCurrentTuple(AbstractTupleSource.java:70)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.BatchIterator.getCurrentTuple(BatchIterator.java:84)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.common.buffer.AbstractTupleSource.nextTuple(AbstractTupleSource.java:48)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.SortUtility.initialSort(SortUtility.java:262)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.SortUtility.sort(SortUtility.java:196)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.SortNode.sortPhase(SortNode.java:112)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.SortNode.getBufferDirect(SortNode.java:206)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.RelationalNode.getBuffer(RelationalNode.java:634)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.relational.LimitNode.getBufferDirect(LimitNode.java:211)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.RelationalNode.getBuffer(RelationalNode.java:634)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.ProjectNode.getBufferDirect(ProjectNode.java:237)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.RelationalNode.getBuffer(RelationalNode.java:634)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.query.processor.relational.RelationalPlan.getBuffer(RelationalPlan.java:285)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.QueryProcessor.getBuffer(QueryProcessor.java:290)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:154)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
[teiid-engine-8.12.5.redhat-8.jar:8.12.5.redhat-8]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[rt.jar:1.8.0-internal]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[rt.jar:1.8.0-internal]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0-internal]
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)