[JBoss JIRA] (TEIID-5276) ClassCastException with OData4 translator when using COUNT function without GROUP BY clause
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5276?page=com.atlassian.jira.plugin... ]
Steven Hawkins resolved TEIID-5276.
-----------------------------------
Fix Version/s: 10.0.4
10.2
10.1.2
Resolution: Done
The detection of count(\*) was missing to trigger the request processing of just the text result.
> ClassCastException with OData4 translator when using COUNT function without GROUP BY clause
> -------------------------------------------------------------------------------------------
>
> Key: TEIID-5276
> URL: https://issues.jboss.org/browse/TEIID-5276
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12.11.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
> Fix For: 10.0.4, 10.2, 10.1.2
>
>
> Given that {{BQT1.SmallA}} is backed by OData4 translator, I'm unable to run any queries including the {{COUNT}} aggregation function unless I'm also including a GROUP BY clause (if I include any GROUP BY, it seems to work).
> Example:
> {noformat}
> SELECT COUNT(*) FROM BQT1.SmallA
> {noformat}
> Full exception:
> {noformat}
> 10:30:22,795 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue140) TEIID30020 Processing exception for request nIb4rK3XZNgv.18 'TEIID30504 odata4: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode'. Originally TeiidProcessingException JsonEntitySetDeserializer.java:53.: org.teiid.core.TeiidProcessingException: TEIID30504 odata4: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:401) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:161) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:391) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:281) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.LimitNode.nextBatchDirect(LimitNode.java:102) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:281) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> 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]
> Caused by: org.teiid.translator.TranslatorException: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleError(ConnectorWorkItem.java:305) [teiid-engine-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:364) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> 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) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at com.sun.proxy.$Proxy91.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> 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) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> ... 6 more
> Caused by: java.lang.ClassCastException: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at org.apache.olingo.client.core.serialization.JsonEntitySetDeserializer.doDeserialize(JsonEntitySetDeserializer.java:53)
> at org.apache.olingo.client.core.serialization.JsonDeserializer.toEntitySet(JsonDeserializer.java:410)
> at org.teiid.translator.odata4.ODataResponse.parsePayload(ODataResponse.java:65)
> at org.teiid.translator.odata4.ODataResponse.<init>(ODataResponse.java:54)
> at org.teiid.translator.odata4.ODataQueryExecution$1.<init>(ODataQueryExecution.java:96)
> at org.teiid.translator.odata4.ODataQueryExecution.execute(ODataQueryExecution.java:95)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:361) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> ... 17 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 10 months
[JBoss JIRA] (TEIID-5281) Issue with concatenating null strings with OData translator
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5281?page=com.atlassian.jira.plugin... ]
Steven Hawkins commented on TEIID-5281:
---------------------------------------
[~jmartisk] This doesn't seem to be mandated by odata, and I don't see the same behavior against the reference service. Can you provide a full picture about everything involved - presumably this is an odata4 translator hitting an odata4 service exposed by Teiid, but which backend are you hitting?
> Issue with concatenating null strings with OData translator
> -----------------------------------------------------------
>
> Key: TEIID-5281
> URL: https://issues.jboss.org/browse/TEIID-5281
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12.11.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
> Priority: Minor
>
> There is a difference in behavior of {{CONCAT(x,y)}} function in Teiid SQL and the {{concat(x,y)}} filtering function in OData - the SQL function will return null if one of the arguments is null, but the OData function will return the non-null argument in this case.
> This leads to some peculiar behavior that for rows where A='10' and B=null, the query
> {noformat}
> SELECT concat(A, B) = '10'
> FROM BQT1.SmallA
> WHERE concat(A, B) = '10';
> {noformat}
> will return a row containing {{false}}, because the expression in the SELECT clause will be evaluated by Teiid, whereas the one in the WHERE clause will be evaluated by the OData {{concat}} function.
> This is against the documented behavior of Teiid's {{CONCAT}} function, because such row should not be returned at all.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 10 months
[JBoss JIRA] (TEIID-5276) ClassCastException with OData4 translator when using COUNT function without GROUP BY clause
by Steven Hawkins (JIRA)
[ https://issues.jboss.org/browse/TEIID-5276?page=com.atlassian.jira.plugin... ]
Work on TEIID-5276 started by Steven Hawkins.
---------------------------------------------
> ClassCastException with OData4 translator when using COUNT function without GROUP BY clause
> -------------------------------------------------------------------------------------------
>
> Key: TEIID-5276
> URL: https://issues.jboss.org/browse/TEIID-5276
> Project: Teiid
> Issue Type: Bug
> Components: OData
> Affects Versions: 8.12.11.6_4
> Reporter: Jan Martiska
> Assignee: Steven Hawkins
>
> Given that {{BQT1.SmallA}} is backed by OData4 translator, I'm unable to run any queries including the {{COUNT}} aggregation function unless I'm also including a GROUP BY clause (if I include any GROUP BY, it seems to work).
> Example:
> {noformat}
> SELECT COUNT(*) FROM BQT1.SmallA
> {noformat}
> Full exception:
> {noformat}
> 10:30:22,795 WARN [org.teiid.PROCESSOR] (Worker0_QueryProcessorQueue140) TEIID30020 Processing exception for request nIb4rK3XZNgv.18 'TEIID30504 odata4: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode'. Originally TeiidProcessingException JsonEntitySetDeserializer.java:53.: org.teiid.core.TeiidProcessingException: TEIID30504 odata4: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at org.teiid.dqp.internal.process.DataTierTupleSource.exceptionOccurred(DataTierTupleSource.java:401) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DataTierTupleSource.nextTuple(DataTierTupleSource.java:161) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.AccessNode.nextBatchDirect(AccessNode.java:391) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:281) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.LimitNode.nextBatchDirect(LimitNode.java:102) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.RelationalNode.nextBatch(RelationalNode.java:281) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.relational.RelationalPlan.nextBatch(RelationalPlan.java:145) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.QueryProcessor.nextBatchDirect(QueryProcessor.java:151) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.QueryProcessor.nextBatch(QueryProcessor.java:114) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:164) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.query.processor.BatchCollector.collectTuples(BatchCollector.java:146) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.RequestWorkItem.processMore(RequestWorkItem.java:472) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.RequestWorkItem.process(RequestWorkItem.java:348) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.AbstractWorkItem.run(AbstractWorkItem.java:51) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.RequestWorkItem.run(RequestWorkItem.java:274) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DQPWorkContext.runInContext(DQPWorkContext.java:284) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$RunnableWrapper.run(ThreadReuseExecutor.java:119) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.ThreadReuseExecutor$3.run(ThreadReuseExecutor.java:210) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> 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]
> Caused by: org.teiid.translator.TranslatorException: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.handleError(ConnectorWorkItem.java:305) [teiid-engine-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:364) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> 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) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at com.sun.proxy.$Proxy91.execute(Unknown Source)
> at org.teiid.dqp.internal.process.DataTierTupleSource.getResults(DataTierTupleSource.java:306) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:112) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> at org.teiid.dqp.internal.process.DataTierTupleSource$1.call(DataTierTupleSource.java:108) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> 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) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> ... 6 more
> Caused by: java.lang.ClassCastException: com.fasterxml.jackson.databind.node.IntNode cannot be cast to com.fasterxml.jackson.databind.node.ObjectNode
> at org.apache.olingo.client.core.serialization.JsonEntitySetDeserializer.doDeserialize(JsonEntitySetDeserializer.java:53)
> at org.apache.olingo.client.core.serialization.JsonDeserializer.toEntitySet(JsonDeserializer.java:410)
> at org.teiid.translator.odata4.ODataResponse.parsePayload(ODataResponse.java:65)
> at org.teiid.translator.odata4.ODataResponse.<init>(ODataResponse.java:54)
> at org.teiid.translator.odata4.ODataQueryExecution$1.<init>(ODataQueryExecution.java:96)
> at org.teiid.translator.odata4.ODataQueryExecution.execute(ODataQueryExecution.java:95)
> at org.teiid.dqp.internal.datamgr.ConnectorWorkItem.execute(ConnectorWorkItem.java:361) [teiid-engine-8.12.11.6_4-redhat-64-12.jar:8.12.11.6_4-redhat-64-12]
> ... 17 more
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 10 months
[JBoss JIRA] (TEIID-5282) Add source fully qualified name extension properties
by Steven Hawkins (JIRA)
Steven Hawkins created TEIID-5282:
-------------------------------------
Summary: Add source fully qualified name extension properties
Key: TEIID-5282
URL: https://issues.jboss.org/browse/TEIID-5282
Project: Teiid
Issue Type: Enhancement
Components: Misc. Connectors
Reporter: Steven Hawkins
Assignee: Steven Hawkins
Fix For: 10.2
To support TEIIDTOOLS-362 and in general the lookup of source objects by a name other than the Teiid name, we need to add a fully qualified name property.
The proposal would look like an ldap name containing both the name/parts:
create foreign table "schemaName.tableName" (...) options ('teiid_rel:fqn' 'catalog:catalogName/schema:schemaName/table:tableName');
The names will reflect the constructs for each source:
google: 'worksheet:name/sheet:name'
salesforce: 'sObject:name'
etc.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 10 months
[JBoss JIRA] (TEIID-5281) Issue with concatenating null strings with OData translator
by Jan Martiska (JIRA)
Jan Martiska created TEIID-5281:
-----------------------------------
Summary: Issue with concatenating null strings with OData translator
Key: TEIID-5281
URL: https://issues.jboss.org/browse/TEIID-5281
Project: Teiid
Issue Type: Bug
Components: OData
Affects Versions: 8.12.11.6_4
Reporter: Jan Martiska
Assignee: Steven Hawkins
Priority: Minor
There is a difference in behavior of {{CONCAT(x,y)}} function in Teiid SQL and the {{concat(x,y)}} filtering function in OData - the SQL function will return null if one of the arguments is null, but the OData function will return the non-null argument in this case.
This leads to some peculiar behavior that for rows where A='10' and B=null, the query
{noformat}
SELECT concat(A, B) = '10'
FROM BQT1.SmallA
WHERE concat(A, B) = '10';
{noformat}
will return a row containing {{false}}, because the expression in the SELECT clause will be evaluated by Teiid, whereas the one in the WHERE clause will be evaluated by the OData {{concat}} function.
This is against the documented behavior of Teiid's {{CONCAT}} function, because such row should not be returned at all.
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
6 years, 10 months