]
Steven Hawkins commented on TEIID-5119:
---------------------------------------
This was also addressed in the TEIID-5117 commit.
Osisoft Translator - Teiid pushes cast from Timestamp to Time
-------------------------------------------------------------
Key: TEIID-5119
URL:
https://issues.jboss.org/browse/TEIID-5119
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Ramesh Reddy
Priority: Critical
Labels: CR2
Fix For: 10.0, 8.12.x-6.4
Osisoft PI does not support conversion from Timestamp to Time, however, query such as
{code:sql}
select cast(timestampvalue as time) from source.smalla
{code}
is pushed as
{code:sql}
SELECT cast(g_0.TimestampValue AS Time) FROM dvqe..SmallA AS g_0
{code}
which results in the following stack trace:
{noformat}
(Worker4_QueryProcessorQueue25) Connector worker process failed for
atomic-request=mrbob+Ekp30a.0.0.13: org.teiid.translator.jdbc.JDBCExecutionException: 0
TEIID11008:TEIID11004 Error executing statement(s): [SQL: SELECT cast(g_0.TimestampValue
AS Time) FROM dvqe..SmallA AS g_0]
at
org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131)
[translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
at
org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:363)
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.$Proxy79.execute(Unknown Source)
at
org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306)
at
org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:142)
at
org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:391)
at
org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:281)
at
org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145)
at
org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151)
at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164)
at
org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146)
at
org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472)
at
org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348)
at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51)
at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274)
at
org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
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: [PIOLEDBENT] [SQL Analyzer] [Line 1:6] Cannot cast
'DateTime' to 'Time'.
at com.osisoft.jdbc.StatementImpl.executeQuery(StatementImpl.java:360)
at
org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:344)
at
org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:119)
[translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
... 26 more
Caused by: com.osisoft.rdsa.RdsaException: [PIOLEDBENT] [SQL Analyzer] [Line 1:6] Cannot
cast 'DateTime' to 'Time'.
at com.osisoft.rdsa.Command.ExecuteReader(Native Method)
at com.osisoft.rdsa.Command.executeReader(Command.java:79)
at com.osisoft.jdbc.StatementImpl.executeQuery(StatementImpl.java:356)
... 28 more
{noformat}