]
Ramesh Reddy commented on TEIID-5126:
-------------------------------------
Thanks.
I think we can post the question to their development team and see if we can get into
their queue on any of these driver issues. We can KI on our side.
Osisoft translator - SUBSTRING fails when start > string length
---------------------------------------------------------------
Key: TEIID-5126
URL:
https://issues.jboss.org/browse/TEIID-5126
Project: Teiid
Issue Type: Bug
Components: JDBC Driver
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Ramesh Reddy
Priority: Minor
Fix For: 10.1
Calling a query such as
{code:sql}
SELECT cast(TIMESTAMPVALUE as string), SUBSTRING(TIMESTAMPVALUE, 22, 0) FROM BQT1.SmallA
{code}
fails with the following (the length of timestampvalue converted to string is 20):
{noformat}
Connector worker process failed for atomic-request=HOiQATHW3fPH.12.0.9:
org.teiid.translator.jdbc.JDBCExecutionException: 0 TEIID11008:TEIID11004 Error executing
statement(s): [SQL: SELECT TOP 100 cast(g_0.TimestampValue AS String) AS c_0,
SUBSTR(cast(g_0.TimestampValue AS String), 22, 0) AS c_1 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$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: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] Arguments are invalid.
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]
... 18 more
Caused by: com.osisoft.rdsa.RdsaException: [PIOLEDBENT] Arguments are invalid.
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)
... 20 more
{noformat}
This appears to be an issue with the SUBSTR implementation on the PI server, we are ok
with either a workaround or documenting as KI.