[
https://issues.apache.org/jira/browse/PHOENIX-2888?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15279205#comment-15279205
]
Sergey Soldatov commented on PHOENIX-2888:
------------------------------------------
Aggregation functions are collected in ExpressionManager into HashMap.
{{InListExpression}} hashCode and equals methods doesn't compare/calculate hash
for children expressions (in this case i1 & i2) and if the values are equal
ExpressionManager consider the second expression as already added.
> Aggregations for similar IN list expressions doesn't work correctly
> -------------------------------------------------------------------
>
> Key: PHOENIX-2888
> URL: https://issues.apache.org/jira/browse/PHOENIX-2888
> Project: Phoenix
> Issue Type: Bug
> Reporter: Sergey Soldatov
> Assignee: Sergey Soldatov
> Attachments: PHOENIX-2888-1.patch
>
>
> The test case:
> {noformat}
> create table test (id integer primary key, i1 integer, i2 integer);
> upsert into test values (1,1,1);
> upsert into test values (2,1,11);
> SELECT (SUM(CASE WHEN i1 in (1,2) THEN 1 ELSE 0 END)), (SUM(CASE WHEN i2 in
> (1,2) THEN 1 ELSE 0 END)) from test;
> {noformat}
> Expected result: 2, 1
> Real result : 2,2
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)