Limit keyword causes class cast exception running query against DB2
translator
------------------------------------------------------------------------------
Key: TEIID-1317
URL:
https://jira.jboss.org/browse/TEIID-1317
Project: Teiid
Issue Type: Bug
Components: Query Engine
Affects Versions: 6.2.0, 7.0, 7.1
Reporter: Howard Abrams
Assignee: Steven Hawkins
Fix For: 7.1.1
When running a query that uses the limit keyword against a DB2 database/translator, teiid
will throw the exception below (From the 7.1 codebase, but I got the same exception a
while back playing with 7.0 as well as 6.2). The same query against the same schema in a
different database (H2 for example) works fine. It appears it also works fin on DB2 if you
leave off the starting rowing from the expression.
Examples:
/*works on H2*/
SELECT * FROM MYSCHEMA.FOO LIMIT 0,10
/*fails on DB2*/
SELECT * FROM MYSCHEMA.FOO LIMIT 0,10
/*fails on DB2*/
SELECT * FROM MYSCHEMA.FOO LIMIT 10,10
/*works on DB2*/
SELECT * FROM MYSCHEMA.FOO LIMIT 10
java.lang.ClassCastException: org.teiid.language.Function cannot be cast to
org.teiid.language.Literal
at
org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:719)
at
org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:211)
at
org.teiid.dqp.internal.datamgr.LanguageBridgeFactory.translate(LanguageBridgeFactory.java:130)
at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:215)
at
org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:181)
at
org.teiid.dqp.internal.process.DataTierTupleSource.access$000(DataTierTupleSource.java:53)
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:89)
at
org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:86)
at org.teiid.dqp.internal.process.DQPCore$FutureWork.run(DQPCore.java:107)
at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:188)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:116)
at
org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:290)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:637)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: