[JBoss JIRA] (TEIID-2605) Optimization substitutes wrong column in where clause
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-2605?page=com.atlassian.jira.plugin... ]
Steven Hawkins closed TEIID-2605.
---------------------------------
> Optimization substitutes wrong column in where clause
> -----------------------------------------------------
>
> Key: TEIID-2605
> URL: https://issues.jboss.org/browse/TEIID-2605
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 8.1
> Environment: z/OS
> Reporter: Jeff Hayes
> Assignee: Steven Hawkins
> Attachments: query_plan.txt, views.xml
>
>
> Optimization results in a query with a different column in the WHERE clause producing an empty result set.
> Full query plan is attached but the beginning and ending queries are shown below. Note that the subject column of the IN clause is SCOPEID but optimization changes it to AUTHID for some reason.
> USER COMMAND:
> SELECT * FROM SECURITY.SCPXREF AS CHORUS_B WHERE (CHORUS_B.SYSID = 'DE29') AND ((CHORUS_B.SCOPEID IN (SELECT SN5.SCOPEID FROM SECURI
> TY.SCPNEXT AS SN5 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN4.SCOPEID FROM SECURITY.SCPNEXT AS SN4 WHERE (SYSID = 'DE29') AND
> (NEXTREC IN (SELECT SN3.SCOPEID FROM SECURITY.SCPNEXT AS SN3 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN2.SCOPEID FROM SECURI
> TY.SCPNEXT AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))))))))) OR (CHORUS_B.SCOPEID IN (SELECT SN4.SCOPEID FROM SECURIT
> Y.SCPNEXT AS SN4 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN3.SCOPEID FROM SECURITY.SCPNEXT AS SN3 WHERE (SYSID = 'DE29') AND
> (NEXTREC IN (SELECT SN2.SCOPEID FROM SECURITY.SCPNEXT AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))))))) OR (CHORUS_B.SC
> OPEID IN (SELECT SN3.SCOPEID FROM SECURITY.SCPNEXT AS SN3 WHERE (SYSID = 'DE29') AND (NEXTREC IN (SELECT SN2.SCOPEID FROM SECURITY.S
> CPNEXT AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))))) OR (CHORUS_B.SCOPEID IN (SELECT SN2.SCOPEID FROM SECURITY.SCPNEX
> T AS SN2 WHERE (SYSID = 'DE29') AND (NEXTREC = 'CHRDEPT1'))) OR (CHORUS_B.SCOPEID = 'CHRDEPT1'))
> OPTIMIZATION COMPLETE:
> PROCESSOR PLAN:
> AccessNode(10) output=[x.sysid AS sysid, x.scopeid AS authid, x.authid AS scopeid, x.authtype AS authtype] SELECT g_0.SYSID, g_0.SCO
> PEID, g_0.AUTHID, g_0.AUTHTYPE FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPXREF AS g_0 WHERE (g_0.SYSID = 'DE29') AND ((g_0.AUTHID IN
> (SELECT g_1.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_1 WHERE (g_1.SYSID = 'DE29') AND (g_1.NEXTREC IN (SELECT g_2
> .SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_2 WHERE (g_2.SYSID = 'DE29') AND (g_2.NEXTREC IN (SELECT g_3.SCOPEID FR
> OM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_3 WHERE (g_3.SYSID = 'DE29') AND (g_3.NEXTREC IN (SELECT g_4.SCOPEID FROM SECURITY
> _CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_4 WHERE (g_4.SYSID = 'DE29') AND (g_4.NEXTREC = 'CHRDEPT1'))))))))) OR (g_0.AUTHID IN (SELECT
> g_5.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_5 WHERE (g_5.SYSID = 'DE29') AND (g_5.NEXTREC IN (SELECT g_6.SCOPEI
> D FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_6 WHERE (g_6.SYSID = 'DE29') AND (g_6.NEXTREC IN (SELECT g_7.SCOPEID FROM SECU
> RITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_7 WHERE (g_7.SYSID = 'DE29') AND (g_7.NEXTREC = 'CHRDEPT1'))))))) OR (g_0.AUTHID IN (SELE
> CT g_8.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_8 WHERE (g_8.SYSID = 'DE29') AND (g_8.NEXTREC IN (SELECT g_9.SCOP
> EID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_9 WHERE (g_9.SYSID = 'DE29') AND (g_9.NEXTREC = 'CHRDEPT1'))))) OR (g_0.AUTH
> ID IN (SELECT g_10.SCOPEID FROM SECURITY_CIA_DB2_D91BPTIB_CIADB01.SCPNEXT AS g_10 WHERE (g_10.SYSID = 'DE29') AND (g_10.NEXTREC = 'C
> HRDEPT1'))) OR (g_0.AUTHID = 'CHRDEPT1'))
> The view definitions are shown below:
> <view name="SCPNEXT">
> <columns>
> <column name="sysid" type="varchar"/>
> <column name="scopeid" type="varchar"/>
> <column name="nextrec" type="varchar"/>
> </columns>
> <definition>
> #if ($db.count("select count(*) from sys.tables where Name='config' and SchemaName = 'security_db'") > 0)
> #set ($count = 0)
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> #if ($db.count("select count(*) from sys.tables where SchemaName = 'SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}'") == 0)
> #set ($count = $count + 1)
> #end
> #end
> #if ($count == 0)
> SELECT t.sysid, t.scopeid, t.nextrec
> FROM (
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> SELECT n.sysid, n.scopeid, n.nextrec
> FROM SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}.SCPNEXT n
> #if( $velocityHasNext ) UNION #end
> #end
> ) AS t
> #end
> #end
> </definition>
> </view>
> <view name="SCPXREF">
> <columns>
> <column name="sysid" type="varchar"/>
> <column name="authid" type="varchar"/>
> <column name="scopeid" type="varchar"/>
> <column name="authtype" type="varchar"/>
> </columns>
> <definition>
> #if ($db.count("select count(*) from sys.tables where Name='config' and SchemaName = 'security_db'") > 0)
> #set ($count = 0)
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> #if ($db.count("select count(*) from sys.tables where SchemaName = 'SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}'") == 0)
> #set ($count = $count + 1)
> #end
> #end
> #if ($count == 0)
> SELECT sysid, scopeid, authid, authtype
> FROM (
> #foreach($t in $db.query("select DB_TYPE, DB_LOC, DB_QUAL from security_db.config WHERE TYPE = 'CIA'"))
> SELECT x.sysid, x.scopeid, x.authid, x.authtype
> FROM SECURITY_CIA_${t.DB_TYPE}_${t.DB_LOC}_${t.DB_QUAL}.SCPXREF x
> #if( $velocityHasNext ) UNION #end
> #end
> ) AS t
> #end
> #end
> </definition>
> </view>
> I guess the best way to test this is to define these views and run the input query with SHOWPLAN=DEBUG and see if the AUTHID substitution is occurring.
> Thanks!
--
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
2 weeks
[JBoss JIRA] (TEIID-5489) Provide a full set of geography functions
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5489?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5489:
---------------------------------------
geolatte - does not seem to contain geodetic functions, contrary to the readme
geotools - looks like it should work, but is not in a common repo location
apache sis - looks like it provides spherical, not spheriod calculations. While it's good to have both, the default for postgis was to provide spheriod (the most correct) by default.
> Provide a full set of geography functions
> -----------------------------------------
>
> Key: TEIID-5489
> URL: https://issues.jboss.org/browse/TEIID-5489
> Project: Teiid
> Issue Type: Sub-task
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 11.2
>
>
> The initial set of geography work includes a subset of functions supported by postgis (which does have some documentation issue wrt some of the things that are supported). We'll need to add a geographic library for the computational/relational functions - such as geotools
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 1 month
[JBoss JIRA] (TEIID-5489) Provide a full set of geography functions
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5489?page=com.atlassian.jira.plugin... ]
Steven Hawkins updated TEIID-5489:
----------------------------------
Description: The initial set of geography work includes a subset of functions supported by postgis (which does have some documentation issue wrt some of the things that are supported). We'll need to add a geographic library for the computational/relational functions - such as geotools (was: The initial set of geography work includes a subset of functions supported by postgis (which does have some documentation issue wrt some of the things that are supported). We'll need to add a geodetic library for the computational/relational functions - such as geolatte)
> Provide a full set of geography functions
> -----------------------------------------
>
> Key: TEIID-5489
> URL: https://issues.jboss.org/browse/TEIID-5489
> Project: Teiid
> Issue Type: Sub-task
> Components: Query Engine
> Reporter: Steven Hawkins
> Assignee: Steven Hawkins
> Fix For: 11.2
>
>
> The initial set of geography work includes a subset of functions supported by postgis (which does have some documentation issue wrt some of the things that are supported). We'll need to add a geographic library for the computational/relational functions - such as geotools
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 1 month
[JBoss JIRA] (TEIID-5489) Provide a full set of geography functions
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5489:
-------------------------------------
Summary: Provide a full set of geography functions
Key: TEIID-5489
URL: https://issues.jboss.org/browse/TEIID-5489
Project: Teiid
Issue Type: Sub-task
Components: Query Engine
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 11.2
The initial set of geography work includes a subset of functions supported by postgis (which does have some documentation issue wrt some of the things that are supported). We'll need to add a geodetic library for the computational/relational functions - such as geolatte
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 1 month
[JBoss JIRA] (TEIID-5167) PrestoDB translator - NULL values are not allowed on the probe side of SemiJoin operator
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-5167?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration commented on TEIID-5167:
------------------------------------------------
Debi Rieden <drieden(a)redhat.com> changed the Status of [bug 1515761|https://bugzilla.redhat.com/show_bug.cgi?id=1515761] from ASSIGNED to CLOSED
> PrestoDB translator - NULL values are not allowed on the probe side of SemiJoin operator
> ----------------------------------------------------------------------------------------
>
> Key: TEIID-5167
> URL: https://issues.jboss.org/browse/TEIID-5167
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Driver
> Affects Versions: 8.12.11.6_4
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
>
> When running queries containg a subquery such as
> {code:sql}
> SELECT INTKEY, DOUBLENUM FROM BQT1.SMALLA WHERE DOUBLENUM <> ALL (SELECT DOUBLENUM FROM BQT1.SMALLA WHERE INTKEY = 40)
> {code}
> An exception is thrown:
> {noformat}
> org.teiid.translator.TranslatorException: Unexpected exception while translating results: Query failed (#20171121_103829_00016_8zhqn): NULL values are not allowed on the probe side of SemiJoin operator. See the query plan for details.
> at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:351) [translator-jdbc-8.12.11.6_4-redhat-64-7.jar:8.12.11.6_4-redhat-64-7]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:433)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:236)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_141]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_141]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_141]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_141]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy80.more(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112)
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_141]
> at org.teiid.dqp.internal.process.FutureWork.run(FutureWork.java:65)
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119)
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_141]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_141]
> at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_141]
> Caused by: java.sql.SQLException: Query failed (#20171121_103829_00016_8zhqn): NULL values are not allowed on the probe side of SemiJoin operator. See the query plan for details.
> at com.facebook.presto.jdbc.PrestoResultSet.resultsException(PrestoResultSet.java:1799)
> at com.facebook.presto.jdbc.PrestoResultSet$ResultsPageIterator.computeNext(PrestoResultSet.java:1787)
> at com.facebook.presto.jdbc.PrestoResultSet$ResultsPageIterator.computeNext(PrestoResultSet.java:1756)
> at com.facebook.presto.jdbc.internal.guava.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:145)
> at com.facebook.presto.jdbc.internal.guava.collect.AbstractIterator.hasNext(AbstractIterator.java:140)
> at com.facebook.presto.jdbc.internal.guava.collect.TransformedIterator.hasNext(TransformedIterator.java:42)
> at com.facebook.presto.jdbc.internal.guava.collect.MultitransformedIterator.hasNext(MultitransformedIterator.java:50)
> at com.facebook.presto.jdbc.internal.guava.collect.MultitransformedIterator.hasNext(MultitransformedIterator.java:50)
> at com.facebook.presto.jdbc.PrestoResultSet.next(PrestoResultSet.java:149)
> at org.jboss.jca.adapters.jdbc.WrappedResultSet.next(WrappedResultSet.java:1862)
> at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:338) [translator-jdbc-8.12.11.6_4-redhat-64-7.jar:8.12.11.6_4-redhat-64-7]
> ... 19 more
> {noformat}
> The query is translated as
> {code:sql}
> SELECT g_0.intkey AS c_0, g_0.doublenum AS c_1 FROM smalla AS g_0 WHERE g_0.doublenum NOT IN (SELECT g_1.doublenum FROM smalla AS g_1 WHERE g_1.intkey = 40)
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 1 month
[JBoss JIRA] (TEIID-5485) JOIN of a table and sub-query containing DISTINCT and table function of a procedural call with arguments fails
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/TEIID-5485?page=com.atlassian.jira.plugin... ]
RH Bugzilla Integration updated TEIID-5485:
-------------------------------------------
Bugzilla References: https://bugzilla.redhat.com/show_bug.cgi?id=1633663
Bugzilla Update: Perform
> JOIN of a table and sub-query containing DISTINCT and table function of a procedural call with arguments fails
> --------------------------------------------------------------------------------------------------------------
>
> Key: TEIID-5485
> URL: https://issues.jboss.org/browse/TEIID-5485
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 11.1
> Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 11.2, 11.0.3, 10.3.5, 11.1.2
>
>
> JOIN of a table and sub-query containing DISTINCT and table function of a procedural call with arguments, like:
> {code:sql}
> SELECT t2.i
> FROM (
> SELECT DISTINCT 1 a, b from test_tables_pg.test_x) t1,
> table(CALL "views.pr"(arg => t1.a)
> ) sub
> JOIN test_tables_pg.test_y t2 ON true ;;
> {code}
> fails with the following stack trace:
> {code:noformat}
> 2018-09-25 17:47:15,024 ERROR [org.teiid.TRANSPORT] (NIO1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: org.teiid.core
> .TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.Boolean". Please ensure that the column's modeled datatype matc
> hes the expected data.
> at org.teiid.transport.ObjectEncoder.write(ObjectEncoder.java:132)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)
> at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)
> at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)
> at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:106)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)
> at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:38)
> at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1089)
> at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1078)
> at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
> at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.Boolean". Please ensure that the colum
> n's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:874)
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:315)
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
> at org.teiid.net.socket.Message.writeExternal(Message.java:57)
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
> at org.teiid.transport.ObjectEncoder.write(ObjectEncoder.java:112)
> ... 15 more
> Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
> at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:559)
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:530)
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:863)
> ... 26 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 1 month
[JBoss JIRA] (TEIID-5485) JOIN of a table and sub-query containing DISTINCT and table function of a procedural call with arguments fails
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5485?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5485:
---------------------------------------
No problem. It is a pretty narrow set of circumstances, but it does have the potential to mix up result columns, so it needed to be addressed.
> JOIN of a table and sub-query containing DISTINCT and table function of a procedural call with arguments fails
> --------------------------------------------------------------------------------------------------------------
>
> Key: TEIID-5485
> URL: https://issues.jboss.org/browse/TEIID-5485
> Project: Teiid
> Issue Type: Bug
> Components: Query Engine
> Affects Versions: 11.1
> Environment: teiid-11.1.0 (from 01.09.2018) on WildFly Full 11.0.0.Final (WildFly Core 3.0.8.Final)
> Reporter: dalex dalex
> Assignee: Steven Hawkins
> Priority: Blocker
> Fix For: 11.2, 11.0.3, 10.3.5, 11.1.2
>
>
> JOIN of a table and sub-query containing DISTINCT and table function of a procedural call with arguments, like:
> {code:sql}
> SELECT t2.i
> FROM (
> SELECT DISTINCT 1 a, b from test_tables_pg.test_x) t1,
> table(CALL "views.pr"(arg => t1.a)
> ) sub
> JOIN test_tables_pg.test_y t2 ON true ;;
> {code}
> fails with the following stack trace:
> {code:noformat}
> 2018-09-25 17:47:15,024 ERROR [org.teiid.TRANSPORT] (NIO1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: org.teiid.core
> .TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.Boolean". Please ensure that the column's modeled datatype matc
> hes the expected data.
> at org.teiid.transport.ObjectEncoder.write(ObjectEncoder.java:132)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)
> at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)
> at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)
> at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:106)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)
> at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)
> at io.netty.channel.AbstractChannelHandlerContext.access$1900(AbstractChannelHandlerContext.java:38)
> at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1089)
> at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1078)
> at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
> at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:403)
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442)
> at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.Boolean". Please ensure that the colum
> n's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:874)
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:315)
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
> at org.teiid.net.socket.Message.writeExternal(Message.java:57)
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1459)
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1430)
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
> at org.teiid.transport.ObjectEncoder.write(ObjectEncoder.java:112)
> ... 15 more
> Caused by: java.lang.ClassCastException: java.lang.Boolean cannot be cast to java.lang.Integer
> at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:559)
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:530)
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:863)
> ... 26 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 1 month