Alexandra Gaspar created TEIID-5845:
---------------------------------------
Summary: NullPointerException when running query
Key: TEIID-5845
URL:
https://issues.jboss.org/browse/TEIID-5845
Project: Teiid
Issue Type: Bug
Reporter: Alexandra Gaspar
Assignee: Steven Hawkins
Running a query of the following format causes a NullPointerException :
{code:java}
SELECT col1, col2, col3
FROM TeiidView1
WHERE col2 = 'value'
GROUP BY col1
ORDER BY NVL(col3, 0) DESC
{code}
If adding adding a limit at the end of the query, it runs successfully. Similarly,
removing the `NVL` function also results in the query returning results without any
errors.
This is the stack trace:
{noformat}
TEIID30019 Unexpected exception for request b+HUTj++9EfY.0:
java.lang.NullPointerException
at
org.teiid.query.optimizer.relational.rules.RulePlanSorts.checkForProjectOptimization(RulePlanSorts.java:333)
[teiid-engine-9.1.5.jar:9.1.5]
at
org.teiid.query.optimizer.relational.rules.RulePlanSorts.optimizeSorts(RulePlanSorts.java:91)
[teiid-engine-9.1.5.jar:9.1.5]
at
org.teiid.query.optimizer.relational.rules.RulePlanSorts.execute(RulePlanSorts.java:69)
[teiid-engine-9.1.5.jar:9.1.5]
at
org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1007)
[teiid-engine-9.1.5.jar:9.1.5]
at
org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:232)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:186)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:453)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.Request.processRequest(Request.java:481)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:657)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:338)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:275)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:282)
[teiid-engine-9.1.5.jar:9.1.5]
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
[teiid-engine-9.1.5.jar:9.1.5]
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
[teiid-engine-9.1.5.jar:9.1.5]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[rt.jar:1.8.0_181]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[rt.jar:1.8.0_181]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_181]
{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)