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

James Taylor commented on PHOENIX-3158:
---------------------------------------

Would be good to clean it up to be more explicit. Seems like there are a few 
cases now:
- no aggregation is being done, which I believe can be checked with {{groupBy 
== GroupBy.EMPTY_GROUP_BY}}. We may use the GroupBy.isEmpty() for this check 
currently. Within the AggregatePlan, though, we know we're aggregating, so the 
check was really to find the case of an ungrouped aggregation.
- ungrouped aggregation is being done. I think this can be checked with 
{{groupBy.isUngroupedAggregate()}}. This is somewhat confusing, though, because 
it used to mean there are no group by expressions. However, with COUNT 
DISTINCT, we push a group by expression.
- We should probably make the GroupBy.UNGROUPED_GROUP_BY singleton private so 
that no one does {{groupBy == GroupBy.UNGROUPED_GROUP_BY}} by mistake for this 
check. The singleton is really just saving instances from being created.
- I'm not sure if there's a special case necessary for 
{{groupBy.isUngroupedAggregate()}} to know if it's truly an ungrouped 
aggregation versus a distinct case. Hopefully we don't need to differentiate.

Maybe a 4.9 thing?



> COUNT(DISTINCT) may return null instead of 0 after PHOENIX-258
> --------------------------------------------------------------
>
>                 Key: PHOENIX-3158
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3158
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Lars Hofhansl
>            Assignee: Lars Hofhansl
>             Fix For: 4.8.1
>
>         Attachments: 3158-fix.txt, 3158.txt
>
>
> This is fine to fix in 4.8.1.
> I'll attach a test to indicate the issue.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to