Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-5192

Osisoft Translator - selecting ABS on a long value causes NPE

    XMLWordPrintable

    Details

      Description

      Running a query such as

      SELECT LongNum, ABS(LongNum) AS ABSLongNum FROM BQT2.SmallB
      

      results in a NullPointerException while translating the results. The type of LongNum column on the datasource is int64.

      This does not happen with other column types (integer, float, double).

      When running an equivalent query directly against the Osisoft PI datasource, the correct results are returned and the type of the ABS column is Single (i.e. float). It appears the translator tries to get the ABS value as long, see stacktrace.

      Stacktrace:

      [org.jboss.jca.core.connectionmanager.listener.TxConnectionListener] (Worker15_QueryProcessorQueue84) IJ000305: Connection error occured: org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@4b1e4616[state=NORMAL managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@51027396 connection handles=1 lastUse=1514883684240 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@39789e04 pool internal context=SemaphoreArrayListManagedConnectionPool@6732a357[pool=osisoft] xaResource=LocalXAResourceImpl@52da36f6[connectionListener=4b1e4616 connectionManager=63a083c7 warned=false currentXid=null productName=PI SQL Data Access Server 1.5.16302.2 using PIOLEDBENT productVersion=PIOLEDBENT: 1.4.2.95 jndiName=java:/osisoft] txSync=null]: java.lang.NullPointerException
              at com.osisoft.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:478)
              at org.jboss.jca.adapters.jdbc.WrappedResultSet.getLong(WrappedResultSet.java:1094)
              at org.teiid.translator.jdbc.JDBCExecutionFactory.retrieveValue(JDBCExecutionFactory.java:1004) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              at org.teiid.translator.jdbc.pi.PIExecutionFactory.retrieveValue(PIExecutionFactory.java:322) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:344) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:431)
              at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:234)
              at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) [: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.more(Unknown Source)
              at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
              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:284)
              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]
       
      10:01:31,699 WARN  [org.teiid.CONNECTOR] (Worker15_QueryProcessorQueue84) Connector worker process failed for atomic-request=xcwUXrxLs9We.26.0.18: org.teiid.translator.TranslatorException: Unexpected exception while translating results: Error
              at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:351) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleBatch(ConnectorWorkItem.java:431)
              at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.more(ConnectorWorkItem.java:234)
              at sun.reflect.GeneratedMethodAccessor170.invoke(Unknown Source) [: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.more(Unknown Source)
              at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:309)
              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:284)
              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: Error
              at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1687)
              at org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1267)
              at org.jboss.jca.adapters.jdbc.WrappedResultSet.checkException(WrappedResultSet.java:4063)
              at org.jboss.jca.adapters.jdbc.WrappedResultSet.getLong(WrappedResultSet.java:1098)
              at org.teiid.translator.jdbc.JDBCExecutionFactory.retrieveValue(JDBCExecutionFactory.java:1004) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              at org.teiid.translator.jdbc.pi.PIExecutionFactory.retrieveValue(PIExecutionFactory.java:322) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              at org.teiid.translator.jdbc.JDBCQueryExecution.next(JDBCQueryExecution.java:344) [translator-jdbc-8.12.11.6_4-redhat-64-9.jar:8.12.11.6_4-redhat-64-9]
              ... 18 more
      Caused by: java.lang.NullPointerException
              at com.osisoft.jdbc.ResultSetImpl.getLong(ResultSetImpl.java:478)
              at org.jboss.jca.adapters.jdbc.WrappedResultSet.getLong(WrappedResultSet.java:1094)
              ... 21 more
      
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                rareddy Ramesh Reddy
                Reporter:
                asmigala Andrej Šmigala
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: