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:
SELECT COUNT(*) FROM BQT1.SmallA
Full exception:
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