[JBoss JIRA] (TEIID-3719) Add Log4j 1 Logger Adapter
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3719?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3719.
-----------------------------------
Fix Version/s: 8.12
Resolution: Done
Switched embedded to use JBoss Logging by default, which can use Log4j 1 as a provider. The attached class can be used though if someone doesn't want the additional level of indirection.
The embedded docs were updated by Kylin and I to reflect this change.
> Add Log4j 1 Logger Adapter
> --------------------------
>
> Key: TEIID-3719
> URL: https://issues.jboss.org/browse/TEIID-3719
> Project: Teiid
> Issue Type: Feature Request
> Components: Embedded
> Affects Versions: 8.11.4
> Environment: Apache Maven 3.3.3 (7994120775791599e205a5524ec3e0dfe41d4a06; 2015-04-22T04:57:37-07:00)
> Maven home: C:\Java\apache-maven-3.3.3
> Java version: 1.7.0_79, vendor: Oracle Corporation
> Java home: C:\Program Files\Java\jdk1.7.0_79\jre
> Default locale: en_US, platform encoding: Cp1252
> OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
> Reporter: Gary Gregory
> Assignee: Steven Hawkins
> Fix For: 8.12
>
> Attachments: Log4j1LoggerAdapter.java
>
>
> Add a Log4j 1 Logger Adapter. See attached.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months
[JBoss JIRA] (TEIID-3726) CTEs combined with constant values yield an error message
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3726?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3726:
---------------------------------------
Ok, I have it. The projection minimization at the access node level is not being taken into account when there is a common table expression.
> CTEs combined with constant values yield an error message
> ---------------------------------------------------------
>
> Key: TEIID-3726
> URL: https://issues.jboss.org/browse/TEIID-3726
> Project: Teiid
> Issue Type: Bug
> Reporter: Salvatore R
> Assignee: Steven Hawkins
>
> When a statement contains a WITH clause and then uses the defined table expression in combination with a constant expression for a column in the SELECT clause, different exceptions are thrown, depending on the datatype in the CTE.
> For example, running the following query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT 123 as col2, tmp.* FROM tmp
> {code}
> where pg.test1 has only one column of "string" datatype, this exception is thrown:
> {code:sql}
> 11:38:48,960 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) 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.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:878) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
> at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:563) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:534) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 36 more
> {code}
> If datatypes match, like in this query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT '123' as col2, tmp.* FROM tmp
> {code}
> a different exception is thrown:
> {code:sql}
> 11:41:22,456 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at java.util.ArrayList.rangeCheck(ArrayList.java:635) [rt.jar:1.7.0_67]
> at java.util.ArrayList.get(ArrayList.java:411) [rt.jar:1.7.0_67]
> at org.teiid.client.BatchSerializer.writeIsNullData(BatchSerializer.java:476) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:529) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months
[JBoss JIRA] (TEIID-3726) CTEs combined with constant values yield an error message
by Salvatore R (JIRA)
[ https://issues.jboss.org/browse/TEIID-3726?page=com.atlassian.jira.plugin... ]
Salvatore R commented on TEIID-3726:
------------------------------------
I quickly tested it with MySQL and it seems to work correctly there.
> CTEs combined with constant values yield an error message
> ---------------------------------------------------------
>
> Key: TEIID-3726
> URL: https://issues.jboss.org/browse/TEIID-3726
> Project: Teiid
> Issue Type: Bug
> Reporter: Salvatore R
> Assignee: Steven Hawkins
>
> When a statement contains a WITH clause and then uses the defined table expression in combination with a constant expression for a column in the SELECT clause, different exceptions are thrown, depending on the datatype in the CTE.
> For example, running the following query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT 123 as col2, tmp.* FROM tmp
> {code}
> where pg.test1 has only one column of "string" datatype, this exception is thrown:
> {code:sql}
> 11:38:48,960 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) 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.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:878) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
> at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:563) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:534) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 36 more
> {code}
> If datatypes match, like in this query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT '123' as col2, tmp.* FROM tmp
> {code}
> a different exception is thrown:
> {code:sql}
> 11:41:22,456 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at java.util.ArrayList.rangeCheck(ArrayList.java:635) [rt.jar:1.7.0_67]
> at java.util.ArrayList.get(ArrayList.java:411) [rt.jar:1.7.0_67]
> at org.teiid.client.BatchSerializer.writeIsNullData(BatchSerializer.java:476) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:529) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months
[JBoss JIRA] (TEIID-3726) CTEs combined with constant values yield an error message
by Salvatore R (JIRA)
[ https://issues.jboss.org/browse/TEIID-3726?page=com.atlassian.jira.plugin... ]
Salvatore R commented on TEIID-3726:
------------------------------------
pg.test1 is defined in PostgreSQL (but I can reproduce it also in other databases like MS SQL Server) as:
{code:sql}
CREATE TABLE public.test1
(
b character varying(4000)
)
{code}
and the corresponding Teiid column type is string(4000).
Querying directly test1 correctly returns the content of the test table:
||b||
|a|
|b|
Please, let me know if you need additional information.
> CTEs combined with constant values yield an error message
> ---------------------------------------------------------
>
> Key: TEIID-3726
> URL: https://issues.jboss.org/browse/TEIID-3726
> Project: Teiid
> Issue Type: Bug
> Reporter: Salvatore R
> Assignee: Steven Hawkins
>
> When a statement contains a WITH clause and then uses the defined table expression in combination with a constant expression for a column in the SELECT clause, different exceptions are thrown, depending on the datatype in the CTE.
> For example, running the following query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT 123 as col2, tmp.* FROM tmp
> {code}
> where pg.test1 has only one column of "string" datatype, this exception is thrown:
> {code:sql}
> 11:38:48,960 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) 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.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:878) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
> at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:563) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:534) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 36 more
> {code}
> If datatypes match, like in this query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT '123' as col2, tmp.* FROM tmp
> {code}
> a different exception is thrown:
> {code:sql}
> 11:41:22,456 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at java.util.ArrayList.rangeCheck(ArrayList.java:635) [rt.jar:1.7.0_67]
> at java.util.ArrayList.get(ArrayList.java:411) [rt.jar:1.7.0_67]
> at org.teiid.client.BatchSerializer.writeIsNullData(BatchSerializer.java:476) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:529) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months
[JBoss JIRA] (TEIID-3726) CTEs combined with constant values yield an error message
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3726?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-3726:
---------------------------------------
I'm not able to reproduce this. What are the details of pg.test1 - the source and Teiid column types? And what happens when you directly query test1?
> CTEs combined with constant values yield an error message
> ---------------------------------------------------------
>
> Key: TEIID-3726
> URL: https://issues.jboss.org/browse/TEIID-3726
> Project: Teiid
> Issue Type: Bug
> Reporter: Salvatore R
> Assignee: Steven Hawkins
>
> When a statement contains a WITH clause and then uses the defined table expression in combination with a constant expression for a column in the SELECT clause, different exceptions are thrown, depending on the datatype in the CTE.
> For example, running the following query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT 123 as col2, tmp.* FROM tmp
> {code}
> where pg.test1 has only one column of "string" datatype, this exception is thrown:
> {code:sql}
> 11:38:48,960 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) 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.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.String". Please ensure that the column's modeled datatype matches the expected data.
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:878) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
> at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:563) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:534) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 36 more
> {code}
> If datatypes match, like in this query:
> {code:sql}
> WITH tmp as
> (SELECT * FROM pg.test1 )
> SELECT '123' as col2, tmp.* FROM tmp
> {code}
> a different exception is thrown:
> {code:sql}
> 11:41:22,456 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
> at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
> Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
> at java.util.ArrayList.rangeCheck(ArrayList.java:635) [rt.jar:1.7.0_67]
> at java.util.ArrayList.get(ArrayList.java:411) [rt.jar:1.7.0_67]
> at org.teiid.client.BatchSerializer.writeIsNullData(BatchSerializer.java:476) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:529) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
> at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
> at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
> at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
> ... 25 more
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months
[JBoss JIRA] (TEIID-3726) CTEs combined with constant values yield an error message
by Salvatore R (JIRA)
Salvatore R created TEIID-3726:
----------------------------------
Summary: CTEs combined with constant values yield an error message
Key: TEIID-3726
URL: https://issues.jboss.org/browse/TEIID-3726
Project: Teiid
Issue Type: Bug
Reporter: Salvatore R
Assignee: Steven Hawkins
When a statement contains a WITH clause and then uses the defined table expression in combination with a constant expression for a column in the SELECT clause, different exceptions are thrown, depending on the datatype in the CTE.
For example, running the following query:
{code:sql}
WITH tmp as
(SELECT * FROM pg.test1 )
SELECT 123 as col2, tmp.* FROM tmp
{code}
where pg.test1 has only one column of "string" datatype, this exception is thrown:
{code:sql}
11:38:48,960 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) 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.String". Please ensure that the column's modeled datatype matches the expected data.
at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
Caused by: org.teiid.core.TeiidRuntimeException: TEIID20001 The modeled datatype integer for column 0 doesn't match the runtime type "java.lang.String". Please ensure that the column's modeled datatype matches the expected data.
at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:878) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
... 25 more
Caused by: java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Integer
at org.teiid.client.BatchSerializer$IntColumnSerializer.writeObject(BatchSerializer.java:563) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:534) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
... 36 more
{code}
If datatypes match, like in this query:
{code:sql}
WITH tmp as
(SELECT * FROM pg.test1 )
SELECT '123' as col2, tmp.* FROM tmp
{code}
a different exception is thrown:
{code:sql}
11:41:22,456 ERROR [org.teiid.TRANSPORT] (New I/O worker #1) TEIID40113 Unhandled exception, aborting operation: org.teiid.transport.ObjectEncoder$FailedWriteException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:136) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.jboss.netty.channel.Channels.write(Channels.java:704) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
at org.jboss.netty.channel.Channels.write(Channels.java:671) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:248) [netty-3.6.9.Final-redhat-1.jar:3.6.9.Final-redhat-1]
at org.teiid.transport.SSLAwareChannelHandler$ObjectChannelImpl.write(SSLAwareChannelHandler.java:93) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.transport.SocketClientInstance.send(SocketClientInstance.java:88) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.transport.ServerWorkItem.sendResult(ServerWorkItem.java:135) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.transport.ServerWorkItem$1.onCompletion(ServerWorkItem.java:105) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.util.ResultsFuture.done(ResultsFuture.java:135) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.util.ResultsFuture.access$200(ResultsFuture.java:40) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.util.ResultsFuture$1.receiveResults(ResultsFuture.java:79) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.sendResultsIfNeeded(RequestWorkItem.java:984) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem$1.flushBatchDirect(RequestWorkItem.java:666) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.query.processor.BatchCollector.flushBatch(BatchCollector.java:223) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:194) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:462) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:344) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:271) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:276) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.0.Beta3.jar:8.12.0.Beta3]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
at java.util.ArrayList.rangeCheck(ArrayList.java:635) [rt.jar:1.7.0_67]
at java.util.ArrayList.get(ArrayList.java:411) [rt.jar:1.7.0_67]
at org.teiid.client.BatchSerializer.writeIsNullData(BatchSerializer.java:476) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.BatchSerializer$ColumnSerializer.writeColumn(BatchSerializer.java:529) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.BatchSerializer.writeBatch(BatchSerializer.java:867) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at org.teiid.client.ResultsMessage.writeExternal(ResultsMessage.java:319) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
at org.teiid.net.socket.Message.writeExternal(Message.java:61) [teiid-client-8.12.0.Beta3.jar:8.12.0.Beta3]
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1458) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1429) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1177) [rt.jar:1.7.0_67]
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:347) [rt.jar:1.7.0_67]
at org.teiid.transport.ObjectEncoder.handleDownstream(ObjectEncoder.java:131) [teiid-runtime-8.12.0.Beta3.jar:8.12.0.Beta3]
... 25 more
{code}
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months
[JBoss JIRA] (TEIID-3636) SalesForce.com aggregate function query issues
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-3636?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-3636.
-----------------------------------
Resolution: Done
Added a translator property SupportsGroupBy to disable group by pushdown. This is the simplest fix that can be done, but will have a performance on group bys that produce less than 2000 rows.
> SalesForce.com aggregate function query issues
> ----------------------------------------------
>
> Key: TEIID-3636
> URL: https://issues.jboss.org/browse/TEIID-3636
> Project: Teiid
> Issue Type: Quality Risk
> Components: Query Engine
> Affects Versions: 8.7.1
> Environment: RHEL 6, AWS VM, JBoss EAP (standalone) 6.3.2.GA
> JBoss Data Virtualization 6.1.0.ER4
> Reporter: Jorge Herrera
> Assignee: Steven Hawkins
> Priority: Minor
> Fix For: 8.12
>
>
> When executing a query against salesforce.com with an aggregate function (select max(), min(), sum() ) With a 'group by' clause with a 'SalesForce ID' returns with the following error:
> TEIID30504 Remote org.teiid.core.TeiidProcessingException: TEIID30504 SalesForce_Sales: com.sforce.soap.partner.UnexpectedErrorFault: EXCEEDED_ID_LIMIT: Aggregate query does not support queryMore(), use LIMIT to restrict the results to a single batch [SQL State=50000, DB Errorcode=30504]
> Example Queries That FAIL:
> ----------
> SELECT accountid, sum(amount)
> FROM salesforce_sales.salesforce.opportunity where closedate > '2016-02-01'
> group by accountid;
> ----------
> SELECT aid, sum(amt) from (
> SELECT accountid aid, amount amt FROM salesforce_sales.salesforce.opportunity where closedate > '2016-02-01'
> ) as tmp group by aid;
> Queries that DO Work:
> SELECT closedate, sum(amount)
> FROM salesforce_sales.salesforce.opportunity where closedate > '2016-02-01' group by closedate
> ;
> SELECT isdeleted, sum(amount)
> FROM salesforce_sales.salesforce.opportunity where closedate > '2016-02-01' group by isdeleted
> ;
> SELECT campaignid, sum(amount)
> FROM salesforce_sales.salesforce.opportunity where closedate > '2016-02-01' group by campaignid
> ;
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
9 years, 3 months