[JBoss JIRA] (TEIID-5116) Osisoft Translator - NULL values in numeric columns returned as zeroes
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5116?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-5116.
---------------------------------
Resolution: Done
Labels: CR2 (was: )
> Osisoft Translator - NULL values in numeric columns returned as zeroes
> ----------------------------------------------------------------------
>
> Key: TEIID-5116
> URL: https://issues.jboss.org/browse/TEIID-5116
> 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
>
>
> NULL values in columns with a numeric type (all of int8, int16 etc, single, double) are returned as 0.
> This is due to a bug/quirk of the Osisoft PI JDBC driver, which is hard-coded to return false from the wasNull method.
> On the Teiid side, the code in JDBCExecutionFactory.retrieveValue() assumes (completely reasonably) that the wasNull method is implemented correctly:
> {code:java}
> case DataTypeManager.DefaultTypeCodes.INTEGER: {
> int value = results.getInt(columnIndex);
> if(results.wasNull()) {
> return null;
> }
> return Integer.valueOf(value);
> }
> {code}
> I managed to workaround the bug in the PI JDBC driver by overriding the retrieveValue() in PIExecutionFactory and replacing the calls to wasNull like this:
> {code:java}
> case DataTypeManager.DefaultTypeCodes.INTEGER: {
> int value = results.getInt(columnIndex);
> if (results.getObject(columnIndex) == null) {
> return null;
> }
> return Integer.valueOf(value);
> }
> {code}
> but that probably isn't the best solution.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5119) Osisoft Translator - Teiid pushes cast from Timestamp to Time
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5119?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-5119.
---------------------------------
Resolution: Done
Labels: CR2 (was: )
> 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
>
>
> 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}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5118) Osisoft Translator - NPE when using ORDER BY
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5118?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-5118.
---------------------------------
Resolution: Done
Labels: CR2 (was: )
> Osisoft Translator - NPE when using ORDER BY
> --------------------------------------------
>
> Key: TEIID-5118
> URL: https://issues.jboss.org/browse/TEIID-5118
> 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
>
> Attachments: osisoft-pi-vdb.xml
>
>
> Any query with an ORDER BY clause run against Osisoft PI datasource fails with a NullPointerException
> Stack trace:
> {noformat}
> 10:17:09,235 ERROR [org.teiid.CONNECTOR] (Worker3_QueryProcessorQueue17) Connector worker process failed for atomic-request=mcBkcBzOiieD.5.0.5: java.lang.NullPointerException
> at org.teiid.translator.jdbc.pi.PISQLConversionVisitor.visit(PISQLConversionVisitor.java:157) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.ColumnReference.acceptVisitor(ColumnReference.java:72) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:737) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.SortSpecification.acceptVisitor(SortSpecification.java:53) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:102) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:733) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.OrderBy.acceptVisitor(OrderBy.java:45) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:790) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.Select.acceptVisitor(Select.java:110) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.translator.jdbc.TranslatedCommand.translateCommand(TranslatedCommand.java:76) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.translator.jdbc.JDBCBaseExecution.translateCommand(JDBCBaseExecution.java:120) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:114) [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]
> {noformat}
> I tried remote debugging the server process and it appears that when running query such as
> {code:sql}
> SELECT FloatNum FROM BQT1.SmallA ORDER BY FloatNum ASC
> {code}
> the PISQLConversionVisitor.visit(ColumnReference obj) is called twice, the first time the ColumnReference object has value "g_0.FloatNum" and all fields set, the second time the object has only name set to "c_2" and nothing else (table, metadata object etc).
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5117) Osisoft Translator - Casting to bigdecimal results in NULL value
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5117?page=com.atlassian.jira.plugin... ]
Ramesh Reddy resolved TEIID-5117.
---------------------------------
Resolution: Done
Labels: CR2 (was: )
> Osisoft Translator - Casting to bigdecimal results in NULL value
> ----------------------------------------------------------------
>
> Key: TEIID-5117
> URL: https://issues.jboss.org/browse/TEIID-5117
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Ramesh Reddy
> Labels: CR2
> Fix For: 10.0
>
>
> Casting any value obtained from an Osisoft PI datasource results in NULL, regardless of the original value.
> E.g. a query such as
> {code:sql}
> select cast(stringnum as bigdecimal), cast(intnum as bigdecimal), cast(shortvalue as bigdecimal) from Source.smalla
> {code}
> returns result set full of NULLs.
> The SOURCE SRC COMMAND in teiid-command.log for this query is however
> {code:sql}
> SELECT g_0.StringNum, g_0.IntNum, g_0.ShortValue FROM dvqe..SmallA AS g_0
> {code}
> i.e. the cast is not pushed down (as Osisoft doesn't support bigdecimal datatype).
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5118) Osisoft Translator - NPE when using ORDER BY
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5118?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-5118:
--------------------------------
Fix Version/s: 10.0
> Osisoft Translator - NPE when using ORDER BY
> --------------------------------------------
>
> Key: TEIID-5118
> URL: https://issues.jboss.org/browse/TEIID-5118
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Ramesh Reddy
> Priority: Critical
> Fix For: 10.0
>
> Attachments: osisoft-pi-vdb.xml
>
>
> Any query with an ORDER BY clause run against Osisoft PI datasource fails with a NullPointerException
> Stack trace:
> {noformat}
> 10:17:09,235 ERROR [org.teiid.CONNECTOR] (Worker3_QueryProcessorQueue17) Connector worker process failed for atomic-request=mcBkcBzOiieD.5.0.5: java.lang.NullPointerException
> at org.teiid.translator.jdbc.pi.PISQLConversionVisitor.visit(PISQLConversionVisitor.java:157) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.ColumnReference.acceptVisitor(ColumnReference.java:72) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:737) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.SortSpecification.acceptVisitor(SortSpecification.java:53) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:102) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:733) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.OrderBy.acceptVisitor(OrderBy.java:45) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.language.visitor.SQLStringVisitor.visit(SQLStringVisitor.java:790) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.Select.acceptVisitor(Select.java:110) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.language.visitor.SQLStringVisitor.append(SQLStringVisitor.java:91) [teiid-api-8.12.11.6_4-redhat-64-6.jar:8.12.11.6_4-redhat-64-6]
> at org.teiid.translator.jdbc.SQLConversionVisitor.append(SQLConversionVisitor.java:130) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.translator.jdbc.TranslatedCommand.translateCommand(TranslatedCommand.java:76) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.translator.jdbc.JDBCBaseExecution.translateCommand(JDBCBaseExecution.java:120) [translator-jdbc-8.12.11.6_4.jar:8.12.11.6_4]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:114) [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]
> {noformat}
> I tried remote debugging the server process and it appears that when running query such as
> {code:sql}
> SELECT FloatNum FROM BQT1.SmallA ORDER BY FloatNum ASC
> {code}
> the PISQLConversionVisitor.visit(ColumnReference obj) is called twice, the first time the ColumnReference object has value "g_0.FloatNum" and all fields set, the second time the object has only name set to "c_2" and nothing else (table, metadata object etc).
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5120) Osisoft Translator - Wrong pushdown of LENGTH function
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5120?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-5120:
--------------------------------
Fix Version/s: 10.0
> Osisoft Translator - Wrong pushdown of LENGTH function
> ------------------------------------------------------
>
> Key: TEIID-5120
> URL: https://issues.jboss.org/browse/TEIID-5120
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Ramesh Reddy
> Fix For: 10.0
>
>
> The LENGTH function is pushed down to Osisoft PI as-is, but fails on the datasource with
> {noformat}
> com.osisoft.rdsa.RdsaException: [PIOLEDBENT] [SQL Analyzer] [Line 0:4294967295] Function name 'length' is invalid.
> {noformat}
> This seems to be a mistake in PI OLEDB Enterprise 2016 User Guide, as this document mentions on page 32 that LENGTH is an alias for LEN.
> However, since LEN actually works, I suggest changing the pushdown in teiid as a workaround.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5117) Osisoft Translator - Casting to bigdecimal results in NULL value
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5117?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-5117:
--------------------------------
Fix Version/s: 10.0
> Osisoft Translator - Casting to bigdecimal results in NULL value
> ----------------------------------------------------------------
>
> Key: TEIID-5117
> URL: https://issues.jboss.org/browse/TEIID-5117
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Ramesh Reddy
> Fix For: 10.0
>
>
> Casting any value obtained from an Osisoft PI datasource results in NULL, regardless of the original value.
> E.g. a query such as
> {code:sql}
> select cast(stringnum as bigdecimal), cast(intnum as bigdecimal), cast(shortvalue as bigdecimal) from Source.smalla
> {code}
> returns result set full of NULLs.
> The SOURCE SRC COMMAND in teiid-command.log for this query is however
> {code:sql}
> SELECT g_0.StringNum, g_0.IntNum, g_0.ShortValue FROM dvqe..SmallA AS g_0
> {code}
> i.e. the cast is not pushed down (as Osisoft doesn't support bigdecimal datatype).
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5119) Osisoft Translator - Teiid pushes cast from Timestamp to Time
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5119?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-5119:
--------------------------------
Fix Version/s: 10.0
> 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
> Fix For: 10.0
>
>
> 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}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5116) Osisoft Translator - NULL values in numeric columns returned as zeroes
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5116?page=com.atlassian.jira.plugin... ]
Ramesh Reddy updated TEIID-5116:
--------------------------------
Fix Version/s: 10.0
> Osisoft Translator - NULL values in numeric columns returned as zeroes
> ----------------------------------------------------------------------
>
> Key: TEIID-5116
> URL: https://issues.jboss.org/browse/TEIID-5116
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Ramesh Reddy
> Priority: Critical
> Fix For: 10.0
>
>
> NULL values in columns with a numeric type (all of int8, int16 etc, single, double) are returned as 0.
> This is due to a bug/quirk of the Osisoft PI JDBC driver, which is hard-coded to return false from the wasNull method.
> On the Teiid side, the code in JDBCExecutionFactory.retrieveValue() assumes (completely reasonably) that the wasNull method is implemented correctly:
> {code:java}
> case DataTypeManager.DefaultTypeCodes.INTEGER: {
> int value = results.getInt(columnIndex);
> if(results.wasNull()) {
> return null;
> }
> return Integer.valueOf(value);
> }
> {code}
> I managed to workaround the bug in the PI JDBC driver by overriding the retrieveValue() in PIExecutionFactory and replacing the calls to wasNull like this:
> {code:java}
> case DataTypeManager.DefaultTypeCodes.INTEGER: {
> int value = results.getInt(columnIndex);
> if (results.getObject(columnIndex) == null) {
> return null;
> }
> return Integer.valueOf(value);
> }
> {code}
> but that probably isn't the best solution.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months
[JBoss JIRA] (TEIID-5117) Osisoft Translator - Casting to bigdecimal results in NULL value
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5117?page=com.atlassian.jira.plugin... ]
Work on TEIID-5117 started by Ramesh Reddy.
-------------------------------------------
> Osisoft Translator - Casting to bigdecimal results in NULL value
> ----------------------------------------------------------------
>
> Key: TEIID-5117
> URL: https://issues.jboss.org/browse/TEIID-5117
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Ramesh Reddy
>
> Casting any value obtained from an Osisoft PI datasource results in NULL, regardless of the original value.
> E.g. a query such as
> {code:sql}
> select cast(stringnum as bigdecimal), cast(intnum as bigdecimal), cast(shortvalue as bigdecimal) from Source.smalla
> {code}
> returns result set full of NULLs.
> The SOURCE SRC COMMAND in teiid-command.log for this query is however
> {code:sql}
> SELECT g_0.StringNum, g_0.IntNum, g_0.ShortValue FROM dvqe..SmallA AS g_0
> {code}
> i.e. the cast is not pushed down (as Osisoft doesn't support bigdecimal datatype).
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
7 years, 2 months