hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jesus Camacho Rodriguez (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-12223) Filter on Grouping__ID does not work properly
Date Wed, 04 Nov 2015 15:31:27 GMT

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

Jesus Camacho Rodriguez commented on HIVE-12223:
------------------------------------------------

I have just updated it to be more precise. Thanks

> Filter on Grouping__ID does not work properly
> ---------------------------------------------
>
>                 Key: HIVE-12223
>                 URL: https://issues.apache.org/jira/browse/HIVE-12223
>             Project: Hive
>          Issue Type: Bug
>          Components: Logical Optimizer
>    Affects Versions: 1.3.0, 2.0.0
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>             Fix For: 1.3.0, 2.0.0
>
>         Attachments: HIVE-12223.01.patch, HIVE-12223.patch
>
>
> Consider the following query:
> {noformat}
> SELECT key, value, GROUPING__ID, count(*)
> FROM T1
> GROUP BY key, value
> GROUPING SETS ((), (key))
> HAVING GROUPING__ID = 1
> {noformat}
> This query will not return results.
> The reason is that a "constant" placeholder is introduced by SemanticAnalyzer for the
GROUPING\__ID column. At execution time, this placeholder is replaced by the actual value
of the GROUPING\__ID. As the column is a constant, the Hive optimizer (combination of PPD
and constant folding) will evaluate statically whether the condition is met or not, leading
to incorrect results.
> We should be able to recognize the placeholder and avoid PPD pushing the filter predicate
to the GroupBy operator.



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

Mime
View raw message