[JBoss JIRA] (TEIID-2861) Partitioned UNION query fails
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2861?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-2861.
---------------------------------
> Partitioned UNION query fails
> -----------------------------
>
> Key: TEIID-2861
> URL: https://issues.jboss.org/browse/TEIID-2861
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.6
> Reporter: Tom Arnold
> Assignee: Steven Hawkins
> Labels: 8.6, oracle, partitioned, query, union
>
> I have a query like this where FOO and BAR are two different Oracle databases.
> {code:sql}
> select * from (
> (select item_id, created_at, 'Foo' source from foo.items order by created_at desc limit 5000)
> union all
> (select item_id, created_at, 'Bar' source from bar.items order by created_at desc limit 5000)
> ) x
> where
> source in ('Foo', 'Bar')
> order by created_at desc
> limit 0, 500;
> {code}
> If I adjust the filter to only include results from the second query, I get an exception.
> {code}
> 09:15:19,287 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue50) 7rl0TEA59SdU TEIID30019 Unexpected exception for request 7rl0TEA59SdU.7: java.lang.ArrayIndexOutOfBoundsException: -1
> at java.util.ArrayList.elementData(ArrayList.java:400) [rt.jar:1.7.0_51]
> at java.util.ArrayList.get(ArrayList.java:413) [rt.jar:1.7.0_51]
> at org.teiid.query.optimizer.relational.rules.RuleRaiseNull.raiseNullNode(RuleRaiseNull.java:170) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.relational.rules.RuleRaiseNull.execute(RuleRaiseNull.java:70) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:606) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:255) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:159) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:408) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:435) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:600) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:309) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:248) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:273) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:214) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
> {code}
> I noticed that if I remove the ORDER BY from the BAR query it seems to work (although obviously not the results I want).
> Here is the debug plan.
> {code}
> 09:15:19,265 DEBUG [org.teiid.COMMAND_LOG] (New I/O worker #2) 7rl0TEA59SdU START USER COMMAND: startTime=2014-02-24 09:15:19.264 requestID=7rl0TEA59SdU.7 txID=null sessionID=7rl0TEA59SdU applicationName=JDBCprincipal=user@teiid-security vdbName=Foo vdbVersion=1 sql=select * from (
> (select item_id, created_at, 'Foo' source from foo.products order by created_at desc limit 5000)
> union all
> (select item_id, created_at, 'Bar' source from bar.products order by created_at desc limit 5000)
> ) x
> where
> source in ('Bar')
> order by created_at desc
> limit 0, 500
> 09:15:19,279 INFO [org.teiid.PLANNER] (Worker5_QueryProcessorQueue50) 7rl0TEA59SdU
> ============================================================================
> USER COMMAND:
> SELECT * FROM ((SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000)) AS x WHERE x.source = 'Bar' ORDER BY x.CREATED_AT DESC LIMIT 500
>
> ----------------------------------------------------------------------------
> OPTIMIZE:
> SELECT * FROM ((SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000)) AS x WHERE x.source = 'Bar' ORDER BY x.CREATED_AT DESC LIMIT 500
>
> ----------------------------------------------------------------------------
> GENERATE CANONICAL:
> SELECT * FROM ((SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000)) AS x WHERE x.source = 'Bar' ORDER BY x.CREATED_AT DESC LIMIT 500
>
> CANONICAL PLAN:
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=500})
> Sort(groups=[x], props={SORT_ORDER=ORDER BY x.CREATED_AT DESC})
> Project(groups=[x], props={PROJECT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> Select(groups=[x], props={SELECT_CRITERIA=x.source = 'Bar'})
> Source(groups=[x], props={NESTED_COMMAND=(SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000), SYMBOL_MAP={x.ITEM_ID=foo.ITEMS.ITEM_ID, x.CREATED_AT=foo.ITEMS.CREATED_AT, x.source='Foo'}, PARTITION_INFO={x.source=[['Foo'], ['Bar']]}})
> SetOperation(groups=[], props={SET_OPERATION=UNION, USE_ALL=true})
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000})
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC})
> Project(groups=[foo.ITEMS], props={PROJECT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source]})
> Source(groups=[foo.ITEMS])
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000})
> Sort(groups=[bar.ITEMS], props={SORT_ORDER=ORDER BY bar.ITEMS.CREATED_AT DESC})
> Project(groups=[bar.ITEMS], props={PROJECT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source]})
> Source(groups=[bar.ITEMS])
>
> ============================================================================
> EXECUTING PlaceAccess
>
> AFTER:
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=500})
> Sort(groups=[x], props={SORT_ORDER=ORDER BY x.CREATED_AT DESC})
> Project(groups=[x], props={PROJECT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> Select(groups=[x], props={SELECT_CRITERIA=x.source = 'Bar'})
> Source(groups=[x], props={NESTED_COMMAND=(SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000), SYMBOL_MAP={x.ITEM_ID=foo.ITEMS.ITEM_ID, x.CREATED_AT=foo.ITEMS.CREATED_AT, x.source='Foo'}, PARTITION_INFO={x.source=[['Foo'], ['Bar']]}})
> SetOperation(groups=[], props={SET_OPERATION=UNION, USE_ALL=true})
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000})
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC})
> Project(groups=[foo.ITEMS], props={PROJECT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source]})
> Access(groups=[foo.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=foo, nameInSource=null, uuid=tid:3af63e7dfae5-000194c4-00000000})
> Source(groups=[foo.ITEMS])
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000})
> Sort(groups=[bar.ITEMS], props={SORT_ORDER=ORDER BY bar.ITEMS.CREATED_AT DESC})
> Project(groups=[bar.ITEMS], props={PROJECT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source]})
> Access(groups=[bar.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=bar, nameInSource=null, uuid=tid:7079feeb259f-00259c3e-00000000})
> Source(groups=[bar.ITEMS])
>
> ============================================================================
> EXECUTING AssignOutputElements
>
> AFTER:
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=500, OUTPUT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> Sort(groups=[x], props={SORT_ORDER=ORDER BY x.CREATED_AT DESC, OUTPUT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> Project(groups=[x], props={PROJECT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source], OUTPUT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> Select(groups=[x], props={SELECT_CRITERIA=x.source = 'Bar', OUTPUT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> Source(groups=[x], props={NESTED_COMMAND=(SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000), SYMBOL_MAP={x.source='Foo', x.ITEM_ID=foo.ITEMS.ITEM_ID, x.CREATED_AT=foo.ITEMS.CREATED_AT}, PARTITION_INFO={x.source=[['Foo'], ['Bar']]}, OUTPUT_COLS=[x.source, x.ITEM_ID, x.CREATED_AT]})
> SetOperation(groups=[], props={SET_OPERATION=UNION, USE_ALL=true, OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000, OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC, OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Project(groups=[foo.ITEMS], props={PROJECT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT], OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Access(groups=[foo.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=foo, nameInSource=null, uuid=tid:3af63e7dfae5-000194c4-00000000, OUTPUT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Source(groups=[foo.ITEMS], props={OUTPUT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000, OUTPUT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Sort(groups=[bar.ITEMS], props={SORT_ORDER=ORDER BY bar.ITEMS.CREATED_AT DESC, OUTPUT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Project(groups=[bar.ITEMS], props={PROJECT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT], OUTPUT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Access(groups=[bar.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=bar, nameInSource=null, uuid=tid:7079feeb259f-00259c3e-00000000, OUTPUT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Source(groups=[bar.ITEMS], props={OUTPUT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
>
> ============================================================================
> EXECUTING PushSelectCriteria
>
> AFTER:
> TupleLimit(groups=[])
> Sort(groups=[x])
> Project(groups=[x])
> Select(groups=[x], props={SELECT_CRITERIA=x.source = 'Bar', OUTPUT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source], IS_PHANTOM=true})
> Source(groups=[x], props={NESTED_COMMAND=(SELECT foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source FROM foo.ITEMS ORDER BY foo.ITEMS.CREATED_AT DESC LIMIT 5000) UNION ALL (SELECT bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source FROM bar.ITEMS ORDER BY bar.ITEMS.CREATED_AT DESC LIMIT 5000), SYMBOL_MAP={x.source='Foo', x.ITEM_ID=foo.ITEMS.ITEM_ID, x.CREATED_AT=foo.ITEMS.CREATED_AT}, PARTITION_INFO={x.source=[['Foo'], ['Bar']]}, OUTPUT_COLS=[x.source, x.ITEM_ID, x.CREATED_AT]})
> SetOperation(groups=[])
> TupleLimit(groups=[])
> Sort(groups=[foo.ITEMS])
> Project(groups=[foo.ITEMS], props={PROJECT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT], OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Access(groups=[foo.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=foo, nameInSource=null, uuid=tid:3af63e7dfae5-000194c4-00000000, OUTPUT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Select(groups=[], props={SELECT_CRITERIA=1 = 0})
> Source(groups=[foo.ITEMS], props={OUTPUT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> TupleLimit(groups=[])
> Sort(groups=[bar.ITEMS])
> Project(groups=[bar.ITEMS], props={PROJECT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT], OUTPUT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Access(groups=[bar.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=bar, nameInSource=null, uuid=tid:7079feeb259f-00259c3e-00000000, OUTPUT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Select(groups=[], props={SELECT_CRITERIA=1 = 1})
> Source(groups=[bar.ITEMS], props={OUTPUT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
>
> ============================================================================
> EXECUTING MergeVirtual
>
> AFTER:
> TupleLimit(groups=[])
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC, OUTPUT_COLS=[x.ITEM_ID, x.CREATED_AT, x.source]})
> SetOperation(groups=[], props={SET_OPERATION=UNION, USE_ALL=true, OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> TupleLimit(groups=[])
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC, OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Project(groups=[foo.ITEMS], props={PROJECT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source], OUTPUT_COLS=['Foo' AS source, foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT]})
> Access(groups=[foo.ITEMS])
> Select(groups=[])
> Source(groups=[foo.ITEMS])
> TupleLimit(groups=[])
> Sort(groups=[bar.ITEMS])
> Project(groups=[bar.ITEMS], props={PROJECT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source], OUTPUT_COLS=['Bar' AS source, bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT]})
> Access(groups=[bar.ITEMS])
> Select(groups=[])
> Source(groups=[bar.ITEMS])
>
> ============================================================================
> EXECUTING CleanCriteria
>
> AFTER:
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=500, OUTPUT_COLS=null})
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC, OUTPUT_COLS=null})
> SetOperation(groups=[], props={SET_OPERATION=UNION, USE_ALL=true, OUTPUT_COLS=null})
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000, OUTPUT_COLS=null})
> Sort(groups=[foo.ITEMS], props={SORT_ORDER=ORDER BY foo.ITEMS.CREATED_AT DESC, OUTPUT_COLS=null})
> Project(groups=[foo.ITEMS], props={PROJECT_COLS=[foo.ITEMS.ITEM_ID, foo.ITEMS.CREATED_AT, 'Foo' AS source], OUTPUT_COLS=null})
> Access(groups=[foo.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=foo, nameInSource=null, uuid=tid:3af63e7dfae5-000194c4-00000000, OUTPUT_COLS=null})
> Null(groups=[foo.ITEMS])
> TupleLimit(groups=[], props={MAX_TUPLE_LIMIT=5000, OUTPUT_COLS=null})
> Sort(groups=[bar.ITEMS], props={SORT_ORDER=ORDER BY bar.ITEMS.CREATED_AT DESC, OUTPUT_COLS=null})
> Project(groups=[bar.ITEMS], props={PROJECT_COLS=[bar.ITEMS.ITEM_ID, bar.ITEMS.CREATED_AT, 'Bar' AS source], OUTPUT_COLS=null})
> Access(groups=[bar.ITEMS], props={SOURCE_HINT=null, MODEL_ID=Schema name=bar, nameInSource=null, uuid=tid:7079feeb259f-00259c3e-00000000, OUTPUT_COLS=null})
> Source(groups=[bar.ITEMS], props={OUTPUT_COLS=null})
>
> ============================================================================
> EXECUTING RaiseNull
>
> 09:15:19,286 DEBUG [org.teiid.COMMAND_LOG] (Worker5_QueryProcessorQueue50) 7rl0TEA59SdU ERROR USER COMMAND: endTime=2014-02-24 09:15:19.286 requestID=7rl0TEA59SdU.7 txID=null sessionID=7rl0TEA59SdU principal=user@teiid-security vdbName=Foo vdbVersion=1 finalRowCount=null
> 09:15:19,287 ERROR [org.teiid.PROCESSOR] (Worker5_QueryProcessorQueue50) 7rl0TEA59SdU TEIID30019 Unexpected exception for request 7rl0TEA59SdU.7: java.lang.ArrayIndexOutOfBoundsException: -1
> at java.util.ArrayList.elementData(ArrayList.java:400) [rt.jar:1.7.0_51]
> at java.util.ArrayList.get(ArrayList.java:413) [rt.jar:1.7.0_51]
> at org.teiid.query.optimizer.relational.rules.RuleRaiseNull.raiseNullNode(RuleRaiseNull.java:170) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.relational.rules.RuleRaiseNull.execute(RuleRaiseNull.java:70) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:606) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:255) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:159) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:408) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.Request.processRequest(Request.java:435) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:600) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:309) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:248) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:273) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:214) [teiid-engine-8.6.0.Final.jar:8.6.0.Final]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
> at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2656) Teiid OData Servlet throws java.lang.NullPointerException on every GET
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2656?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-2656.
---------------------------------
> Teiid OData Servlet throws java.lang.NullPointerException on every GET
> ----------------------------------------------------------------------
>
> Key: TEIID-2656
> URL: https://issues.jboss.org/browse/TEIID-2656
> Project: Teiid
> Issue Type: Bug
> Affects Versions: 8.3, 8.4
> Environment: Windows 7 64 bit
> Oracle JDK 1.7.0 update 17
> JBoss AS 7.1.1 + Teiid 8.3 (both resteasy-jaxrs 2.3.5 and 2.3.7)
> JBoss EAP 6.1 + Teiid 8.4 (resteasy-jaxrs 2.3.6)
> Reporter: John Muller
> Assignee: Ramesh Reddy
> Labels: final
> Fix For: 8.5, 8.4.2
>
> Attachments: server.log, Teiid_8.4_on_JBoss_EAP_6.1Alpha_RHEL6.log
>
>
> A simple GET on any Teiid 8.3 or 8.4 OData ReST resource results in a Null Pointer:
> 11:43:20,166 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/odata].[Resteasy]] (http-localhost-127.0.0.1-8080-2) Servlet.service() for servlet Resteasy threw exception: java.lang.NullPointerException
> at com.ctc.wstx.sw.BaseStreamWriter.writeCharacters(BaseStreamWriter.java:447)
> at org.codehaus.stax2.ri.Stax2EventWriterImpl.add(Stax2EventWriterImpl.java:124)
> at org.odata4j.stax2.staximpl.StaxXMLWriter2.writeText(StaxXMLWriter2.java:108) [odata4j-core-0.8.0-SNAPSHOT-redhat.jar:]
> at org.odata4j.format.xml.AtomErrorFormatWriter.writeError(AtomErrorFormatWriter.java:31) [odata4j-core-0.8.0-SNAPSHOT-redhat.jar:]
> at org.odata4j.format.xml.AtomErrorFormatWriter.write(AtomErrorFormatWriter.java:20) [odata4j-core-0.8.0-SNAPSHOT-redhat.jar:]
> at org.odata4j.format.xml.AtomErrorFormatWriter.write(AtomErrorFormatWriter.java:15) [odata4j-core-0.8.0-SNAPSHOT-redhat.jar:]
> at org.teiid.odata.ODataExceptionMappingProvider.toResponse(ODataExceptionMappingProvider.java:55) [classes:]
> at org.teiid.odata.ODataExceptionMappingProvider.toResponse(ODataExceptionMappingProvider.java:42) [classes:]
> at org.jboss.resteasy.core.SynchronousDispatcher.executeExceptionMapper(SynchronousDispatcher.java:344) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.unwrapException(SynchronousDispatcher.java:373) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:362) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:233) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:209) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:557) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:126) [resteasy-jaxrs-2.3.7.Final.jar:]
> at org.teiid.odata.ODataServletContainerDispatcher.service(ODataServletContainerDispatcher.java:97) [classes:]
> at org.teiid.odata.ODataServlet.service(ODataServlet.java:61) [classes:]
> at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) [resteasy-jaxrs-2.3.7.Final.jar:]
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:489) [jbossweb-7.0.13.Final.jar:]
> at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]
> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]
> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]
> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]
> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]
> at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_17]
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2930) SCROLL keyword for DECLARE CURSOR not being parsed correctly
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2930?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-2930.
-----------------------------------
Fix Version/s: 8.7.1
8.8
Resolution: Done
Updated the syntax pattern and implemented scroll/no scroll behavior.
> SCROLL keyword for DECLARE CURSOR not being parsed correctly
> ------------------------------------------------------------
>
> Key: TEIID-2930
> URL: https://issues.jboss.org/browse/TEIID-2930
> Project: Teiid
> Issue Type: Bug
> Components: ODBC
> Affects Versions: 7.7.8
> Reporter: Johnathon Lee
> Assignee: Steven Hawkins
> Fix For: 8.7.1, 8.8
>
>
> The DECLARE cursor is defined as [1]. However, in [2] line #155, the SCROLL keyword is not being matched. Correction would be to match the pattern fully as defined in [1]
> [1]
> http://www.postgresql.org/docs/8.4/static/sql-declare.html
> [2]
> https://github.com/teiid/teiid/blob/master/runtime/src/main/java/org/teii...
> Example of error:
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking server method: executeQuery [BEGIN;declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>;fetch 100 in "SQL_CUR0x11ad4120"]
> DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: START TRANSACTION
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [START TRANSACTION] expecting: EITHER
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as transaction statement
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: sendUpdateCount [BEGIN, 0]
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [show client_encoding] expecting: RESULTSET
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as show statement
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Creating ResultSet requestID: -1 beginRow: 1 resultsColumns: 1 parameters: 0
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: setEncoding [UTF-8]
> FINE [org.teiid.jdbc] (New I/O server worker #3-1) Statement closed successfully.
> DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2931) Perform equi-join full outer joins in a streaming manner
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2931?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-2931.
-----------------------------------
Resolution: Done
Switched full outer equi joins to use a single pass and the same buffering as a left outer join.
> Perform equi-join full outer joins in a streaming manner
> --------------------------------------------------------
>
> Key: TEIID-2931
> URL: https://issues.jboss.org/browse/TEIID-2931
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.7.1, 8.8
>
>
> A pass to compute the right outer matches is only needed when there is non-equi join criteria, since we'll already have determined the right outer values that fail to match the equi-join predicates on the first pass. Note that second passes are limited only to the match regions, but we don't have effective buffering logic for that so we just fully buffer each side.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2931) Perform equi-join full outer joins in a streaming manner
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2931?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-2931:
----------------------------------
Summary: Perform equi-join full outer joins in a streaming manner (was: Perform equi-join full outer joins in a single pass)
Description: A pass to compute the right outer matches is only needed when there is non-equi join criteria, since we'll already have determined the right outer values that fail to match the equi-join predicates on the first pass. Note that second passes are limited only to the match regions, but we don't have effective buffering logic for that so we just fully buffer each side. (was: A pass to compute the right outer matches is only needed when there is non-equi join criteria, since we'll already have determined the right outer values that fail to match the equi-join predicates on the first pass.)
> Perform equi-join full outer joins in a streaming manner
> --------------------------------------------------------
>
> Key: TEIID-2931
> URL: https://issues.jboss.org/browse/TEIID-2931
> Project: Teiid
> Issue Type: Enhancement
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 8.7.1
>
>
> A pass to compute the right outer matches is only needed when there is non-equi join criteria, since we'll already have determined the right outer values that fail to match the equi-join predicates on the first pass. Note that second passes are limited only to the match regions, but we don't have effective buffering logic for that so we just fully buffer each side.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2931) Perform equi-join full outer joins in a single pass
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-2931:
-------------------------------------
Summary: Perform equi-join full outer joins in a single pass
Key: TEIID-2931
URL: https://issues.jboss.org/browse/TEIID-2931
Project: Teiid
Issue Type: Enhancement
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 8.7.1
A pass to compute the right outer matches is only needed when there is non-equi join criteria, since we'll already have determined the right outer values that fail to match the equi-join predicates on the first pass.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2930) SCROLL keyword for DECLARE CURSOR not being parsed correctly
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-2930?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-2930:
-------------------------------------------
Bugzilla Update: Perform
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1089033
> SCROLL keyword for DECLARE CURSOR not being parsed correctly
> ------------------------------------------------------------
>
> Key: TEIID-2930
> URL: https://issues.jboss.org/browse/TEIID-2930
> Project: Teiid
> Issue Type: Bug
> Components: ODBC
> Affects Versions: 7.7.8
> Reporter: Johnathon Lee
> Assignee: Steven Hawkins
>
> The DECLARE cursor is defined as [1]. However, in [2] line #155, the SCROLL keyword is not being matched. Correction would be to match the pattern fully as defined in [1]
> [1]
> http://www.postgresql.org/docs/8.4/static/sql-declare.html
> [2]
> https://github.com/teiid/teiid/blob/master/runtime/src/main/java/org/teii...
> Example of error:
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking server method: executeQuery [BEGIN;declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>;fetch 100 in "SQL_CUR0x11ad4120"]
> DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: START TRANSACTION
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [START TRANSACTION] expecting: EITHER
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as transaction statement
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: sendUpdateCount [BEGIN, 0]
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [show client_encoding] expecting: RESULTSET
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as show statement
> FINER [org.teiid.jdbc] (New I/O server worker #3-1) Creating ResultSet requestID: -1 beginRow: 1 resultsColumns: 1 parameters: 0
> TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: setEncoding [UTF-8]
> FINE [org.teiid.jdbc] (New I/O server worker #3-1) Statement closed successfully.
> DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months
[JBoss JIRA] (TEIID-2930) SCROLL keyword for DECLARE CURSOR not being parsed correctly
by Johnathon Lee (JIRA)
Johnathon Lee created TEIID-2930:
------------------------------------
Summary: SCROLL keyword for DECLARE CURSOR not being parsed correctly
Key: TEIID-2930
URL: https://issues.jboss.org/browse/TEIID-2930
Project: Teiid
Issue Type: Bug
Components: ODBC
Affects Versions: 7.7.8
Reporter: Johnathon Lee
Assignee: Steven Hawkins
The DECLARE cursor is defined as [1]. However, in [2] line #155, the SCROLL keyword is not being matched. Correction would be to match the pattern fully as defined in [1]
[1]
http://www.postgresql.org/docs/8.4/static/sql-declare.html
[2]
https://github.com/teiid/teiid/blob/master/runtime/src/main/java/org/teii...
Example of error:
TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking server method: executeQuery [BEGIN;declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>;fetch 100 in "SQL_CUR0x11ad4120"]
DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: START TRANSACTION
FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [START TRANSACTION] expecting: EITHER
FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as transaction statement
TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: sendUpdateCount [BEGIN, 0]
FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing: requestID -1 commands: [show client_encoding] expecting: RESULTSET
FINER [org.teiid.jdbc] (New I/O server worker #3-1) Executing as show statement
FINER [org.teiid.jdbc] (New I/O server worker #3-1) Creating ResultSet requestID: -1 beginRow: 1 resultsColumns: 1 parameters: 0
TRACE [org.teiid.ODBC] (New I/O server worker #3-1) invoking client method: setEncoding [UTF-8]
FINE [org.teiid.jdbc] (New I/O server worker #3-1) Statement closed successfully.
DEBUG [org.teiid.ODBC] (New I/O server worker #3-1) Modified Query: declare "SQL_CUR0x11ad4120" scroll cursor for <SQL QUERY>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 8 months