You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Jesus Camacho Rodriguez (JIRA)" <ji...@apache.org> on 2019/03/29 16:45:00 UTC

[jira] [Commented] (HIVE-21544) Constant propagation corrupts coalesce/case/when expressions during folding

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

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

+1

> Constant propagation corrupts coalesce/case/when expressions during folding
> ---------------------------------------------------------------------------
>
>                 Key: HIVE-21544
>                 URL: https://issues.apache.org/jira/browse/HIVE-21544
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Zoltan Haindrich
>            Assignee: Zoltan Haindrich
>            Priority: Major
>         Attachments: HIVE-21544.01.patch
>
>
> {code}
> set hive.fetch.task.conversion=none;
> set hive.optimize.ppd=false;
> create table t (s1 string,s2 string);
> insert into t values (null,null);
> explain
> select
>         coalesce(s1, 'null_value' ), coalesce(s2, 'null_value' ),
>         coalesce(s1, 'null_value' )=coalesce(s2, 'null_value' ),
>         case when coalesce(s1, 'null_value' )=coalesce(s2, 'null_value' ) then 'eq' else 'noteq' end
> from t;
> select
>         coalesce(s1, 'null_value' ), coalesce(s2, 'null_value' ),
>         coalesce(s1, 'null_value' )=coalesce(s2, 'null_value' ),
>         case when coalesce(s1, 'null_value' )=coalesce(s2, 'null_value' ) then 'eq' else 'noteq' end
> from t;
> {code}
> incorrect result is:
> {code}
> null_value      null_value      NULL    noteq
> {code}
> expected result:
> {code}
> null_value     null_value      true    eq
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)