We just upgraded Teiid from 9.1 to Teiid 12.0.2. In Teiid 9.1 we used to run select queries with lierals and subqueries like
insert into tableA(organization,empname,dept) values('ORG-X',(select emp_name from employee where emp_id='1'),'DIVISION-Y') and it used to return the results.
With Teiid 12.x we are receiving a null pointer exception as below
25 05:31:26,541 ERROR [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue478) TEIID30019 Unexpected exception for request enZN3QDAb/U4.2: java.lang.NullPointerException at org.teiid.query.optimizer.relational.rules.RulePlanSubqueries.planMergeJoin(RulePlanSubqueries.java:274) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.query.optimizer.relational.rules.RulePlanSubqueries.processSubqueries(RulePlanSubqueries.java:234) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.query.optimizer.relational.rules.RulePlanSubqueries.processSubqueries(RulePlanSubqueries.java:248) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.query.optimizer.relational.rules.RulePlanSubqueries.execute(RulePlanSubqueries.java:195) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:1101) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:235) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:672) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:351) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:43) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:285) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:281) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:124) [teiid-engine-12.2.2.jar:12.2.2] at org.teiid.dqp.internal.process.ThreadReuseExecutor$2.run(ThreadReuseExecutor.java:212) [teiid-engine-12.2.2.jar:12.2.2] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_202] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_202] at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_202]
Please let me know if this an defect and if there are any workarounds to this issue. We noticed this issue doesn't in Teiid 15.
Try later versions if problem still exists you can open issue in JIRA system for Teiid.
If it doesn't exists in later versions you probably have to apply the fix your self if you want to stay at 12.2 version