[JBoss JIRA] (TEIID-5195) Osisoft translator - applying LIMIT on a UNION query causes syntax error
by Andrej Šmigala (JIRA)
Andrej Šmigala created TEIID-5195:
-------------------------------------
Summary: Osisoft translator - applying LIMIT on a UNION query causes syntax error
Key: TEIID-5195
URL: https://issues.jboss.org/browse/TEIID-5195
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Query such as
{code:sql}
SELECT g_0.intkey FROM bqt1.smalla g_0 UNION SELECT g_1.intkey FROM bqt1.smallb g_1 LIMIT 100
{code}
fails with
{noformat}
[PIOLEDBENT] [SQL Parser] [Line 1:106] Syntax error at 'TOP'
{noformat}
because it is translated as
{code:sql}
SELECT g_1.IntKey AS c_0 FROM dvqe..SmallA AS g_1 UNION SELECT g_0.IntKey AS c_0 FROM dvqe..SmallB AS g_0 TOP 100
{code}
notice the TOP 100 at the end, instead of right after the SELECT.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5194) Osisoft translator - MAX and MIN on boolean column cause an error
by Andrej Šmigala (JIRA)
Andrej Šmigala created TEIID-5194:
-------------------------------------
Summary: Osisoft translator - MAX and MIN on boolean column cause an error
Key: TEIID-5194
URL: https://issues.jboss.org/browse/TEIID-5194
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Running a query such as
{code:sql}
SELECT MAX(BooleanValue) FROM BQT1.SmallA
{code}
fails with the following exception:
{noformat}
java.lang.ClassCastException: java.lang.Byte cannot be cast to java.lang.Boolean
at com.osisoft.jdbc.ResultSetImpl.getBoolean(ResultSetImpl.java:407)
at org.jboss.jca.adapters.jdbc.WrappedResultSet.getBoolean(WrappedResultSet.java:594)
... 22 more
{noformat}
Same issue occurs when using MIN.
Running an equivalent query directly against the Osisoft PI datasource returns the correct result, with the return type being int8 (i.e. byte)
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5193) Osisoft translator - correlated subquery on HAVING clause fails
by Andrej Šmigala (JIRA)
Andrej Šmigala created TEIID-5193:
-------------------------------------
Summary: Osisoft translator - correlated subquery on HAVING clause fails
Key: TEIID-5193
URL: https://issues.jboss.org/browse/TEIID-5193
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Running a query with a correlated subquery in a HAVING clause, such as
{code:sql}
SELECT INTKEY, STRINGKEY FROM BQT1.SMALLA AS A WHERE NOT (INTKEY IN (10)) GROUP BY INTKEY, STRINGKEY HAVING INTKEY = (SELECT MIN(STRINGKEY) FROM BQT1.SMALLA AS B WHERE A.INTKEY = B.INTKEY)
{code}
fails on the datasource with
bq. com.osisoft.rdsa.RdsaException: [PIOLEDBENT] HAVING condition cannot be nonaggregate.
This seems to be an issue on the Osisoft PI datasource side, as running the query directly against the datasource produces the same failure.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5191) Osisoft translator - AVG on integral column returns NULL
by Andrej Šmigala (JIRA)
[ https://issues.jboss.org/browse/TEIID-5191?page=com.atlassian.jira.plugin... ]
Andrej Šmigala edited comment on TEIID-5191 at 1/2/18 4:17 AM:
---------------------------------------------------------------
Same issue when the AVG is on an integral expression such as AVG(LEN(g_0.StringNum)).
was (Author: asmigala):
Same issue when the AVG is on an integral expression such as ``AVG(LEN(g_0.StringNum))``.
> Osisoft translator - AVG on integral column returns NULL
> --------------------------------------------------------
>
> Key: TEIID-5191
> URL: https://issues.jboss.org/browse/TEIID-5191
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
>
> Running a query such as
> {code:sql}
> SELECT AVG(intnum) FROM BQT1.SmallA
> {code}
> returns just a NULL value.
> Running an equivalent query directly against the PI datasource returns the correct result.
> This happens for any column type except for single and double.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5191) Osisoft translator - AVG on integral column returns NULL
by Andrej Šmigala (JIRA)
[ https://issues.jboss.org/browse/TEIID-5191?page=com.atlassian.jira.plugin... ]
Andrej Šmigala commented on TEIID-5191:
---------------------------------------
Same issue when the AVG is on an integral expression such as ``AVG(LEN(g_0.StringNum))``.
> Osisoft translator - AVG on integral column returns NULL
> --------------------------------------------------------
>
> Key: TEIID-5191
> URL: https://issues.jboss.org/browse/TEIID-5191
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.x-6.4
> Reporter: Andrej Šmigala
> Assignee: Steven Hawkins
>
> Running a query such as
> {code:sql}
> SELECT AVG(intnum) FROM BQT1.SmallA
> {code}
> returns just a NULL value.
> Running an equivalent query directly against the PI datasource returns the correct result.
> This happens for any column type except for single and double.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5192) Osisoft Translator - selecting ABS on a long value causes NPE
by Andrej Šmigala (JIRA)
Andrej Šmigala created TEIID-5192:
-------------------------------------
Summary: Osisoft Translator - selecting ABS on a long value causes NPE
Key: TEIID-5192
URL: https://issues.jboss.org/browse/TEIID-5192
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Running a query such as
{code:sql}
SELECT LongNum, ABS(LongNum) AS ABSLongNum FROM BQT2.SmallB
{code}
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:
{noformat}
[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
{noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months
[JBoss JIRA] (TEIID-5191) Osisoft translator - AVG on integral column returns NULL
by Andrej Šmigala (JIRA)
Andrej Šmigala created TEIID-5191:
-------------------------------------
Summary: Osisoft translator - AVG on integral column returns NULL
Key: TEIID-5191
URL: https://issues.jboss.org/browse/TEIID-5191
Project: Teiid
Issue Type: Bug
Components: JDBC Connector
Affects Versions: 8.12.x-6.4
Reporter: Andrej Šmigala
Assignee: Steven Hawkins
Running a query such as
{code:sql}
SELECT AVG(intnum) FROM BQT1.SmallA
{code}
returns just a NULL value.
Running an equivalent query directly against the PI datasource returns the correct result.
This happens for any column type except for single and double.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 11 months