[JBoss JIRA] (TEIID-4649) SybaseIQ translator: different order of arguments in CONVERT function
by Johnathon Lee (JIRA)
[ https://issues.jboss.org/browse/TEIID-4649?page=com.atlassian.jira.plugin... ]
Johnathon Lee updated TEIID-4649:
---------------------------------
Fix Version/s: 8.12.13.6_4
> SybaseIQ translator: different order of arguments in CONVERT function
> ---------------------------------------------------------------------
>
> Key: TEIID-4649
> URL: https://issues.jboss.org/browse/TEIID-4649
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.8.6_3
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Priority: Critical
> Fix For: 9.1.2, 9.2, 8.12.13.6_4
>
>
> Teiid can't push directly CONVERT function via SybaseIQ translator. Sybase/SAP IQ has different order of arguments than Teiid has. See [SAP IQ CONVERT docs|http://help.sap.com/saphelp_iq1611_iqrefbb/helpdata/en/a5/3f6efb84f2...]
> Important to mention is the fact, that CONVERT function is apart from a direct call in user's query also incorporated into resulting source queries by the translator. That will cause issues in lots of queries that need for example implicit conversion to be done.
> For query:
> {code:sql}
> SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA WHERE BQT1.SmallA.CharValue >= '0' AND BQT1.SmallA.CharValue < '1' ORDER BY IntKey
> {code}
> this gets pushed:
> {code:sql}
> [SELECT g_0."intkey" AS c_0 FROM "bqt-server"."dvqe"."SmallA" AS g_0 WHERE convert(g_0."charvalue", string) >= '0' AND convert(g_0."charvalue", string) < '1' ORDER BY c_0]
> {code}
> Error in log:
> {code}
> 08:05:32,921 WARN [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue13) Connector worker process failed for atomic-request=PYp5BTTPF3pK.6.0.0: org.teiid.translator.jdbc.JDBCExecutionException: 102 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT TOP 100 g_0."intkey" AS c_0 FROM "bqt-server"."dvqe"."SmallA" AS g_0 WHERE convert(g_0."charvalue", string) >= '0' AND convert(g_0."charvalue", string) < '1' ORDER BY c_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:366)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_71]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_71]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_71]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy80.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:262) [rt.jar:1.7.0_71]
> 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:1145) [rt.jar:1.7.0_71]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
> Caused by: com.sybase.jdbc4.jdbc.SybSQLException: SQL Anywhere Error -131: Syntax error near 'g_0.charvalue' on line 1
> at com.sybase.jdbc4.tds.Tds.a(Unknown Source)
> at com.sybase.jdbc4.tds.Tds.nextResult(Unknown Source)
> at com.sybase.jdbc4.tds.Tds.getResultSetResult(Unknown Source)
> at com.sybase.jdbc4.tds.TdsCursor.open(Unknown Source)
> at com.sybase.jdbc4.jdbc.SybStatement.executeQuery(Unknown Source)
> at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
> ... 18 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-4650) SybaseIQ translator: week function can't be pushed directly
by Johnathon Lee (JIRA)
[ https://issues.jboss.org/browse/TEIID-4650?page=com.atlassian.jira.plugin... ]
Johnathon Lee updated TEIID-4650:
---------------------------------
Fix Version/s: 8.12.13.6_4
> SybaseIQ translator: week function can't be pushed directly
> -----------------------------------------------------------
>
> Key: TEIID-4650
> URL: https://issues.jboss.org/browse/TEIID-4650
> Project: Teiid
> Issue Type: Bug
> Components: JDBC Connector
> Affects Versions: 8.12.8.6_3
> Reporter: Jan Stastny
> Assignee: Steven Hawkins
> Fix For: 9.1.2, 9.2, 8.12.13.6_4
>
>
> SybaseIQ translator pushes WEEK function calls directly to SAP IQ. SAP IQ doesn't support such function. See [Date and Time Functions docs|http://help.sap.com/saphelp_iq1611_iqrefbb/helpdata/en/a5/2b07be84f2...]
> Query:
> {code:sql}
> SELECT WEEK(dateValue) FROM BQT1.SMALLA;
> {code}
> Pushed source query:
> {code:sql}
> [SELECT week(g_0."datevalue") FROM "bqt-server"."dvqe"."SmallA" AS g_0]
> {code}
> Error in logs:
> {code}
> 08:14:15,830 WARN [org.teiid.CONNECTOR] (Worker3_QueryProcessorQueue19) Connector worker process failed for atomic-request=PYp5BTTPF3pK.8.0.2: org.teiid.translator.jdbc.JDBCExecutionException: 504 TEIID11008:TEIID11004 Error executing statement(s): [Prepared Values: [] SQL: SELECT week(g_0."datevalue") FROM "bqt-server"."dvqe"."SmallA" AS g_0]
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:131) [translator-jdbc-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:366)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_71]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_71]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_71]
> at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_71]
> at org.teiid.dqp.internal.datamgr.ConnectorManager$1.invoke(ConnectorManager.java:211)
> at com.sun.proxy.$Proxy80.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:262) [rt.jar:1.7.0_71]
> 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:1145) [rt.jar:1.7.0_71]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
> at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
> Caused by: com.sybase.jdbc4.jdbc.SybSQLException: SQL Anywhere Error -265: Procedure 'week' not found
> at com.sybase.jdbc4.tds.Tds.a(Unknown Source)
> at com.sybase.jdbc4.tds.Tds.nextResult(Unknown Source)
> at com.sybase.jdbc4.tds.Tds.getResultSetResult(Unknown Source)
> at com.sybase.jdbc4.tds.TdsCursor.open(Unknown Source)
> at com.sybase.jdbc4.jdbc.SybStatement.executeQuery(Unknown Source)
> at com.sybase.jdbc4.jdbc.SybPreparedStatement.executeQuery(Unknown Source)
> at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:462)
> at org.teiid.translator.jdbc.JDBCQueryExecution.execute(JDBCQueryExecution.java:123) [translator-jdbc-8.12.8.6_3-redhat-1.jar:8.12.8.6_3-redhat-1]
> ... 18 more
> {code}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5301) With MongoDB, a query with subquery in HAVING clause doesn't return any results
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5301?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5301:
---------------------------------------
Still need to look more at the original issue - the likely problem is that the having clause can logically be moved to a where clause, but that is not occurring.
The exception is effectively the same as TEIID-5199 - such that a false predicate is being pushed, which is not expected by the translator. It looks like that is in the first fix pack.
> With MongoDB, a query with subquery in HAVING clause doesn't return any results
> -------------------------------------------------------------------------------
>
> Key: TEIID-5301
> URL: https://issues.jboss.org/browse/TEIID-5301
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.12.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
>
> Example:
> {noformat}
> SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = (SELECT INTKEY FROM BQT1.SMALLA WHERE INTKEY = 20)
> {noformat}
> This will not return any results even if there are rows with INTKEY=20.
> If I use a value instead of subquery, it works as expected, this will return a result:
> {noformat}
> SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = 20;
> {noformat}
> Furthermore, if the subquery returns null, the whole query fails with a NPE:
> {noformat}
> SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = (SELECT null);
> 13:43:50,250 ERROR [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue1) Connector worker process failed for atomic-request=mo0zm9PiOEre.0.3.0: java.lang.NullPointerException
> at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) [rt.jar:1.8.0_151]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.getExpressionAlias(MongoDBSelectVisitor.java:808) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.visit(MongoDBSelectVisitor.java:641) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.Comparison.acceptVisitor(Comparison.java:110) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.append(MongoDBSelectVisitor.java:81) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.visit(MongoDBSelectVisitor.java:574) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.Select.acceptVisitor(Select.java:110) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBQueryExecution.execute(MongoDBQueryExecution.java:60) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:361)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
> 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_151]
> 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_151]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
> at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
> 13:43:50,257 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue2) TEIID30020 Processing exception for request mo0zm9PiOEre.0 'TEIID30504 local: null'. Originally TeiidProcessingException ConcurrentHashMap.java:936. Enable more detailed logging to see the entire stacktrace.
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5301) With MongoDB, a query with subquery in HAVING clause doesn't return any results
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5301?page=com.atlassian.jira.plugin... ]
Work on TEIID-5301 started by Steven Hawkins.
---------------------------------------------
> With MongoDB, a query with subquery in HAVING clause doesn't return any results
> -------------------------------------------------------------------------------
>
> Key: TEIID-5301
> URL: https://issues.jboss.org/browse/TEIID-5301
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.12.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
>
> Example:
> {noformat}
> SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = (SELECT INTKEY FROM BQT1.SMALLA WHERE INTKEY = 20)
> {noformat}
> This will not return any results even if there are rows with INTKEY=20.
> If I use a value instead of subquery, it works as expected, this will return a result:
> {noformat}
> SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = 20;
> {noformat}
> Furthermore, if the subquery returns null, the whole query fails with a NPE:
> {noformat}
> SELECT INTKEY FROM BQT1.SMALLA GROUP BY INTKEY HAVING INTKEY = (SELECT null);
> 13:43:50,250 ERROR [org.teiid.CONNECTOR] (Worker1_QueryProcessorQueue1) Connector worker process failed for atomic-request=mo0zm9PiOEre.0.3.0: java.lang.NullPointerException
> at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936) [rt.jar:1.8.0_151]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.getExpressionAlias(MongoDBSelectVisitor.java:808) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.visit(MongoDBSelectVisitor.java:641) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.Comparison.acceptVisitor(Comparison.java:110) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.append(MongoDBSelectVisitor.java:81) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBSelectVisitor.visit(MongoDBSelectVisitor.java:574) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.Select.acceptVisitor(Select.java:110) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.language.visitor.AbstractLanguageVisitor.visitNode(AbstractLanguageVisitor.java:51) [teiid-api-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.translator.mongodb.MongoDBQueryExecution.execute(MongoDBQueryExecution.java:60) [translator-mongodb-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:361)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
> at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
> 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_151]
> 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_151]
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
> at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
> 13:43:50,257 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue2) TEIID30020 Processing exception for request mo0zm9PiOEre.0 'TEIID30504 local: null'. Originally TeiidProcessingException ConcurrentHashMap.java:936. Enable more detailed logging to see the entire stacktrace.
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5297) With MongoDB, null is returned from timestamp functions if the same function is part of WHERE clause
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5297?page=com.atlassian.jira.plugin... ]
Work on TEIID-5297 started by Steven Hawkins.
---------------------------------------------
> With MongoDB, null is returned from timestamp functions if the same function is part of WHERE clause
> ----------------------------------------------------------------------------------------------------
>
> Key: TEIID-5297
> URL: https://issues.jboss.org/browse/TEIID-5297
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.11.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
>
> For example:
> {noformat}
> SELECT timestampvalue, second(timestampvalue) as sec FROM bqt1.hugeA WHERE second(timestampvalue) >= 0
> {noformat}
> This will correctly select rows where {{second(timestampvalue) >= 0}}, but the {{sec}} column in the result will contain only nulls.
> If I remove the WHERE clause:
> {noformat}
> SELECT timestampvalue, second(timestampvalue) as sec FROM bqt1.hugeA;
> {noformat}
> Then the {{sec}} column will be computed correctly.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5296) With MongoDB, timestamp operations throw exceptions when called on null or missing values
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5296?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5296:
---------------------------------------
Thanks [~jmartisk] I'm seeing that same behavior as well. It seems to work to use an equals null check without the ifnull as https://docs.mongodb.com/manual/tutorial/query-for-null-fields/ states it should work for missing as well. So it will look a little simpler:
{code}
{ "$cond" : [ { "$eq" : [ "$e2" , null ]} , null , { "$year" : [ "$e2"]}]}
{code}
> With MongoDB, timestamp operations throw exceptions when called on null or missing values
> -----------------------------------------------------------------------------------------
>
> Key: TEIID-5296
> URL: https://issues.jboss.org/browse/TEIID-5296
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.11.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
>
> When a query contains timestamp operations like {{DAYOFMONTH}}, {{DAYOFWEEK}},.. and these are executed when some cells contain null (or missing field), MongoDB throws an exception. This exception is not handled by Teiid in any way and will fail the whole VDB query:
> {noformat}
> Remote com.mongodb.CommandFailureException:
> { "serverUsed" : "localhost:27017" ,
> "ok" : 0.0 , "errmsg" : "can't convert from BSON type null to Date" ,
> "code" : 16006 , "
> codeName" : "Location16006"}
> {noformat}
> Perhaps Teiid could work around this somehow so that the VDB query will not fail and affected cells will contain null in the result?
> For example, this Mongo aggregation pipeline which extracts hours from timestamps:
> {noformat}
> db.collection.aggregate([
> {
> $project : {
> hour: {$hour: "$DATEVALUE"}
> }
> }
> ])
> {noformat}
> could be transformed to this:
> {noformat}
> db.collection.aggregate([
> {
> $project : {
> hour: { $cond:
> [ { $or: [
> { $eq: [ "$DATEVALUE", null ] },
> { $eq: [ { $type: "$DATEVALUE" }, "missing" ] }
> ]
> },
> null,
> { $hour: "$DATEVALUE" }
> ]
> }
> }
> }
> ])
> {noformat}
> after this transformation, the {{hour}} field will be null as expected for documents where {{DATEVALUE}} is null or missing completely
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5302) Support integration with MapR-DB (MapR 5.2.x, 6.x)
by Ramesh Reddy (JIRA)
[ https://issues.jboss.org/browse/TEIID-5302?page=com.atlassian.jira.plugin... ]
Ramesh Reddy moved TEIIDTOOLS-401 to TEIID-5302:
------------------------------------------------
Project: Teiid (was: Teiid Tools)
Key: TEIID-5302 (was: TEIIDTOOLS-401)
Component/s: Misc. Connectors
(was: data-sources)
> Support integration with MapR-DB (MapR 5.2.x, 6.x)
> --------------------------------------------------
>
> Key: TEIID-5302
> URL: https://issues.jboss.org/browse/TEIID-5302
> Project: Teiid
> Issue Type: Feature Request
> Components: Misc. Connectors
> Reporter: Craig Carpenter
>
> As a user of Teiid, I need to be able to reference MapR-DB as a datasource to incorporate full data content into Teiid (VDB).
> To accept, at a minimum, data read, support should be based on (at least) the current 6.x release. Ideally full RUD support would be available.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5294) Bug with the name correction logic (TEIID30151 eror)
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5294?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5294.
-----------------------------------
Fix Version/s: 10.3
10.1.3
10.0.5
10.2.1
Resolution: Done
There were two issues with the escaping logic. The first highlighted here is that a string ending in _ produced an exception. That has been addressed for all 10.x branches. The other issue is that we were using _u, but should be instead using _x. That has been corrected for 10.3, but left as the old behavior for the other branches. There is a org.teiid.useXMLxEscape system property that has been added/documented to toggle the desired behavior.
> Bug with the name correction logic (TEIID30151 eror)
> ----------------------------------------------------
>
> Key: TEIID-5294
> URL: https://issues.jboss.org/browse/TEIID-5294
> Project: Teiid
> Issue Type: Bug
> Components: VDB
> Affects Versions: 10.1.2
> Reporter: Andreas Krück
> Assignee: Steven Hawkins
> Fix For: 10.3, 10.1.3, 10.0.5, 10.2.1
>
>
> Error message "TEIID30151 Error building Source for context item" when calling SQL statement on VDB connected to REST service:
> 13:13:24,572 WARN [org.teiid.PROCESSOR] (Worker1_QueryProcessorQueue1728) TEIID30020 Processing exception for request ikch7WEdCSyt.10 'TEIID30151 Error building Source for context item.'. Originally TeiidProcessingException '12' XMLSystemFunctions.java:911.: org.teiid.core.TeiidProcessingException: TEIID30151 Error building Source for context item.
> at org.teiid.query.xquery.saxon.XQueryEvaluator.evaluateXQuery(XQueryEvaluator.java:148)
> at org.teiid.query.processor.relational.XMLTableNode$1.run(XMLTableNode.java:269)
> 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(Unknown Source)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
> Caused by: nu.xom.ParsingException: 12
> at nu.xom.Builder.build(Unknown Source)
> at nu.xom.Builder.build(Unknown Source)
> at org.teiid.query.xquery.saxon.XQueryEvaluator.evaluateXQuery(XQueryEvaluator.java:142)
> ... 7 more
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 12
> at org.teiid.query.function.source.XMLSystemFunctions.escapeName(XMLSystemFunctions.java:911)
> at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.startObjectEntry(XMLSystemFunctions.java:226)
> at org.teiid.json.simple.JSONParser.parse(JSONParser.java:232)
> at org.teiid.query.function.source.XMLSystemFunctions$JsonToXmlContentHandler.nextEvent(XMLSystemFunctions.java:351)
> at org.teiid.query.xquery.saxon.XMLEventStreamReader.next(XMLEventStreamReader.java:194)
> at net.sf.saxon.evpull.StaxToEventBridge.next(StaxToEventBridge.java:159)
> at net.sf.saxon.evpull.EventStackIterator.next(EventStackIterator.java:61)
> at net.sf.saxon.evpull.EventIteratorToReceiver.copy(EventIteratorToReceiver.java:44)
> at net.sf.saxon.event.Sender.sendPullEventSource(Sender.java:559)
> at net.sf.saxon.event.Sender.send(Sender.java:132)
> at net.sf.saxon.Configuration.buildDocument(Configuration.java:3361)
> at net.sf.saxon.Configuration.buildDocument(Configuration.java:3303)
> at org.teiid.query.xquery.saxon.SaxonReader.parse(StreamingUtils.java:179)
> ... 10 more
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5300) ClassCastException during query Optimization
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5300?page=com.atlassian.jira.plugin... ]
Work on TEIID-5300 started by Steven Hawkins.
---------------------------------------------
> ClassCastException during query Optimization
> --------------------------------------------
>
> Key: TEIID-5300
> URL: https://issues.jboss.org/browse/TEIID-5300
> Project: Teiid
> Issue Type: Bug
> Environment: Teiid 10.1
> Reporter: Mike Higgins
> Assignee: Steven Hawkins
>
> Using Teiid 10.1 against an Oracle database, if I submit a query with exactly two bind variables such as the following:
>
> SELECT "Small Molecules"."MOLREGNO", "Small Molecules"."CHEMBL_ID",
> "Small Molecules_2"."FULL_MWT", CHEMBL_20.ACTIVITIES."ACTIVITY_ID",
> CHEMBL_20.ACTIVITIES."ACTIVITY_ID", ((CHEMBL_20.ACTIVITIES."ASSAY_ID" ||
> '#') || CHEMBL_20.ACTIVITIES."STANDARD_TYPE") "ID_RESULT",
> CHEMBL_20.ACTIVITIES."STANDARD_UNITS",
> CHEMBL_20.ACTIVITIES."ACTIVITY_COMMENT",
> CHEMBL_20.ACTIVITIES."STANDARD_VALUE"
> FROM (SELECT CHEMBL_20.COMPOUND_STRUCTURES."MOLREGNO",
> SM_DICTIONARY_PRIME."CHEMBL_ID" FROM chembl_20.compound_structures INNER
> JOIN chembl_20.molecule_dictionary SM_DICTIONARY_PRIME ON (
> CHEMBL_20.COMPOUND_STRUCTURES."MOLREGNO" = SM_DICTIONARY_PRIME."MOLREGNO")
> UNION ALL SELECT CHEMBL_20.SM_REPOSITORY."MOLREGNO",
> CHEMBL_20.SM_REPOSITORY."CHEMBL_ID" FROM chembl_20.sm_repository)
> "Small Molecules" LEFT OUTER JOIN chembl_20.compound_properties
> "Small Molecules_2" ON ("Small Molecules"."MOLREGNO" =
> "Small Molecules_2"."MOLREGNO") INNER JOIN chembl_20.activities ON ((
> "Small Molecules"."MOLREGNO" = CHEMBL_20.ACTIVITIES."MOLREGNO") AND ((
> CHEMBL_20.ACTIVITIES."STANDARD_TYPE" = 'IC50') AND (
> CHEMBL_20.ACTIVITIES."ASSAY_ID" IN ('654926', '654933'))))
> WHERE ("Small Molecules"."MOLREGNO" IN (?, ?)
>
> I get the following traceback, indicating that a class that does not implement Comparable is being stored in a TreeMap:
> [exec] 23 Mar 2018 15:04:28,282 [Worker67_QueryProcessorQueue3267] ERROR PROCESSOR- TEIID30019 Unexpected exception for request RkVKlFhEnEgf.0: java.lang.ClassCastException: org.teiid.query.sql.symbol.Reference cannot be cast to java.lang.Comparable
> [exec] at java.util.TreeMap.getEntry(TreeMap.java:349)
> [exec] at java.util.TreeMap.containsKey(TreeMap.java:232)
> [exec] at java.util.TreeSet.contains(TreeSet.java:234)
> [exec] at java.util.AbstractCollection.containsAll(AbstractCollection.java:318)
> [exec] at org.teiid.query.sql.lang.SetCriteria.equals(SetCriteria.java:136)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.copyCriteria(RuleCopyCriteria.java:169)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.createCriteria(RuleCopyCriteria.java:341)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.tryToCopy(RuleCopyCriteria.java:268)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.visitChildern(RuleCopyCriteria.java:384)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.tryToCopy(RuleCopyCriteria.java:294)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.visitChildern(RuleCopyCriteria.java:384)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.tryToCopy(RuleCopyCriteria.java:294)
> [exec] at org.teiid.query.optimizer.relational.rules.RuleCopyCriteria.execute(RuleCopyCriteria.java:99)
> [exec] at org.teiid.query.optimizer.relational.RelationalPlanner.executeRules(RelationalPlanner.java:995)
> [exec] at org.teiid.query.optimizer.relational.RelationalPlanner.optimize(RelationalPlanner.java:228)
> [exec] at org.teiid.query.optimizer.QueryOptimizer.optimizePlan(QueryOptimizer.java:179)
> [exec] at org.teiid.dqp.internal.process.Request.generatePlan(Request.java:458)
> [exec] at org.teiid.dqp.internal.process.PreparedStatementRequest.generatePlan(PreparedStatementRequest.java:124)
> [exec] at org.teiid.dqp.internal.process.Request.processRequest(Request.java:486)
> [exec] at org.teiid.dqp.internal.process.PreparedStatementRequest.processRequest(PreparedStatementRequest.java:345)
> [exec] at org.teiid.dqp.internal.process.RequestWorkItem.processNew(RequestWorkItem.java:660)
> [exec] at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:339)
> [exec] at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:47)
> [exec] at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:276)
> [exec] at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:280)
> [exec] at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:115)
> [exec] at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:206)
> [exec] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [exec] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [exec] at java.lang.Thread.run(Thread.java:745)
> [exec]
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month
[JBoss JIRA] (TEIID-5295) Comparisons of time values don't work correctly for MongoDB
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5295?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5295:
---------------------------------------
> Is this supposed to ignore the date-part stored in MongoDB and only view the time part? Do I get this correctly?
What you have shown above is in the physical model and is not fully supported by the mongodb translator. Mongodb has a date type that corresponds to our timestamp type - https://docs.mongodb.com/manual/reference/bson-types/#timestamps
At best this is undefined behavior.
You can instead use a view to handle the conversion:
CREATE FOREIGN TABLE SmallA ... TIMEVAULE timestamp ...
CREATE VIEW SmallA_VIEW ... TIMEVAULE time ... AS SELECT ... cast(TIMEVALUE as time) as TIMEVALUE ...
However this will prevent most pushown as the conversion function is not supported by the mongodb translator.
We can certainly update the mongodb translator docs as to the supported types as well.
> Comparisons of time values don't work correctly for MongoDB
> -----------------------------------------------------------
>
> Key: TEIID-5295
> URL: https://issues.jboss.org/browse/TEIID-5295
> Project: Teiid
> Issue Type: Bug
> Components: Misc. Connectors
> Affects Versions: 8.12.11.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
>
> Examples of queries which don't behave as expected when running against MongoDB:
> {noformat}
> SELECT BQT1.SmallA.TimeValue FROM BQT1.SmallA WHERE BQT1.SmallA.TimeValue > '17:00:00'
> {noformat}
> returns ALL timevalues which are not null
> {noformat}
> SELECT BQT1.SmallA.TimeValue FROM BQT1.SmallA WHERE BQT1.SmallA.TimeValue < '17:00:00'
> {noformat}
> returns NO timevalues even though there are some less than 17:00
> {noformat}
> SELECT BQT1.SmallA.TimeValue FROM BQT1.SmallA WHERE BQT1.SmallA.TimeValue = '15:00:00'
> {noformat}
> returns nothing
> {noformat}
> SELECT BQT1.SmallA.IntKey FROM BQT1.SmallA WHERE BQT1.SmallA.TimeValue IN (convert('05:00:00', time), convert('15:00:00', time))
> {noformat}
> returns nothing
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 1 month