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

Gopal V commented on HIVE-10636:
--------------------------------

[~ashutoshc]: +1 on the case rotation.

But it misses out on one of the CASE when folds, so HIVE-9644 wasn't 
comprehensive for the NULL and TRUE branch cases.

{code}
hive> explain select count(1) from store_sales where (case ss_sold_date_sk when 
2 then true else null end);
...
    Vertices:
        Map 1 
            Map Operator Tree:
                TableScan
                  alias: store_sales
                  filterExpr: CASE (ss_sold_date_sk) WHEN (2) THEN (true) ELSE 
(null) END (type: boolean)
{code}

the (true) / (null) WHEN is not getting folded, which is the last case (and the 
very first).

Would be nice to get that one is as well (as well as the no-else, which 
defaults to NULL).

{code}
hive> explain select count(1) from store_sales where (case ss_sold_date_sk when 
2 then true end);
OK
...
      Vertices:
        Map 1 
            Map Operator Tree:
                TableScan
                  alias: store_sales
                  filterExpr: CASE (ss_sold_date_sk) WHEN (2) THEN (true) END 
(type: boolean)
{code}

Other than those two cases, everything seems to work fine.

> CASE comparison operator rotation optimization
> ----------------------------------------------
>
>                 Key: HIVE-10636
>                 URL: https://issues.apache.org/jira/browse/HIVE-10636
>             Project: Hive
>          Issue Type: New Feature
>          Components: Logical Optimizer
>    Affects Versions: 0.14.0, 1.0.0, 1.2.0, 1.1.0
>            Reporter: Ashutosh Chauhan
>            Assignee: Ashutosh Chauhan
>         Attachments: HIVE-10636.1.patch, HIVE-10636.2.patch, 
> HIVE-10636.3.patch, HIVE-10636.patch
>
>
> Step 1 as outlined in description of HIVE-9644



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

Reply via email to