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] [Updated] (HIVE-21544) Constant propagation corrupts coalesce/case/when expressions during folding
Date Sat, 30 Mar 2019 01:28:00 GMT

     [ https://issues.apache.org/jira/browse/HIVE-21544?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Jesus Camacho Rodriguez updated HIVE-21544:
-------------------------------------------
       Resolution: Fixed
    Fix Version/s: 4.0.0
           Status: Resolved  (was: Patch Available)

Pushed to master, thanks [~kgyrtkirk]

> 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
>             Fix For: 4.0.0
>
>         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)

Mime
View raw message