[ 
https://issues.apache.org/jira/browse/IGNITE-16191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17484715#comment-17484715
 ] 

Andrey Mashenkov commented on IGNITE-16191:
-------------------------------------------

[~alex_pl] , WDYT? 
can the ticket be closed, or do you expect some particular exception?

> Calcite engine. Unexpected result of COUNT with multiple parameters
> -------------------------------------------------------------------
>
>                 Key: IGNITE-16191
>                 URL: https://issues.apache.org/jira/browse/IGNITE-16191
>             Project: Ignite
>          Issue Type: Bug
>          Components: sql
>            Reporter: Aleksey Plekhanov
>            Assignee: Andrey Mashenkov
>            Priority: Major
>              Labels: calcite2-required, calcite3-required
>
> The calcite engine supports the {{COUNT}} aggregate function with multiple 
> parameters. Such a function should return the number of input rows for which 
> parameters are wholly not null.
> But currently queries like: 
> {noformat}
> SELECT COUNT(null, 1)
> SELECT COUNT(1, null)
> {noformat}
> Return 0 (expected 1).
> Query:
> {noformat}
> SELECT COUNT(null, null)
> {noformat}
> Throw an exception:
> {noformat}
> Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
>       at java.util.ArrayList.rangeCheck(ArrayList.java:657)
>       at java.util.ArrayList.get(ArrayList.java:433)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$WrapperPrototype$1.apply(AccumulatorsFactory.java:226)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$WrapperPrototype$1.apply(AccumulatorsFactory.java:223)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.exp.agg.AccumulatorsFactory$AccumulatorWrapperImpl.add(AccumulatorsFactory.java:305)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode$Grouping.addOnMapper(HashAggregateNode.java:294)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode$Grouping.add(HashAggregateNode.java:265)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode$Grouping.access$100(HashAggregateNode.java:222)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.HashAggregateNode.push(HashAggregateNode.java:127)
>       at 
> org.apache.ignite.internal.processors.query.calcite.exec.rel.ScanNode.push(ScanNode.java:107)
> {noformat}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to