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

Lars Hofhansl commented on PHOENIX-3005:
----------------------------------------

Is this change safe?
{code}
-            if (isOrderPreserving) {
-                return new 
GroupBy.GroupByBuilder(this).setOrderPreservingColumnCount(orderPreservingColumnCount).build();
-            }
-            if (isUngroupedAggregate) {
-                return UNGROUPED_GROUP_BY;
+            if (isOrderPreserving || isUngroupedAggregate) {
+                return new 
GroupBy.GroupByBuilder(this).setIsOrderPreserving(isOrderPreserving).setOrderPreservingColumnCount(orderPreservingColumnCount).build();
             }
{code}

So if this is ungrouped aggregate and we'd return the a new group by (rather 
than UNGROUPED_GROUP_BY) even when order preserving is false. (This change is 
needed BTW, because UNGROUPED_GROUP_BY returns true from isOrderPreserving)

Looks like it's safe.

> Use DistinctPrefixFilter for COUNT(DISTINCT...) index scans
> -----------------------------------------------------------
>
>                 Key: PHOENIX-3005
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-3005
>             Project: Phoenix
>          Issue Type: Sub-task
>            Reporter: Lars Hofhansl
>             Fix For: 4.8.0
>
>         Attachments: 3005-v2.txt, 3005-wip-v1.txt, PHOENIX-3005_v1.patch
>
>
> Currently the optimization in PHOENIX-258 is not used for DISTINCT index 
> scans. We should add that as well.



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

Reply via email to