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

Jesus Camacho Rodriguez edited comment on HIVE-16934 at 6/22/17 9:14 AM:
-------------------------------------------------------------------------

[~vgarg], there are multiple benefits that I can think of. First, at the 
execution side we will not have to access/evaluate any expression when 
calculating the COUNT. Further, by removing expressions that are referenced by 
the aggregate call, we might be able to further prune columns in the operator 
plan. Another benefit is that this might lead to some aggregate calls not being 
computed twice, e.g., {{COUNT\(x\)}} and {{COUNT\(y\)}} if _x_ and _y_ are not 
nullable. Finally, as a side effect, we might be able to recognize more 
equivalent expressions in MVs rewriting or SharedWorkOptimizer, and push more 
computation to Druid, since currently Druid is only capable of executing 
{{COUNT\(*\)}}.


was (Author: jcamachorodriguez):
[~vgarg], there are multiple benefits that I can think of. First, at the 
execution side we will not have to access/evaluate any expression when 
calculating the COUNT. Further, by removing expressions that are referenced by 
the aggregate call, we might be able to further prune columns in the operator 
plan. Another benefit is that this might lead to some aggregate calls not being 
computed twice, e.g., {{COUNT(x)}} and {{COUNT(y)}} if _x_ and _y_ are not 
nullable. Finally, as a side effect, we might be able to recognize more 
equivalent expressions in MVs rewriting or SharedWorkOptimizer, and push more 
computation to Druid, since currently Druid is only capable of executing 
{{count(*)}}.

> Transform COUNT(x) into COUNT() when x is not nullable
> ------------------------------------------------------
>
>                 Key: HIVE-16934
>                 URL: https://issues.apache.org/jira/browse/HIVE-16934
>             Project: Hive
>          Issue Type: Improvement
>          Components: Logical Optimizer
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>         Attachments: HIVE-16934.patch
>
>
> Add a rule to simplify COUNT aggregation function if possible, removing 
> expressions that cannot be nullable from its parameters.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to