You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Pengcheng Xiong (JIRA)" <ji...@apache.org> on 2016/05/13 17:16:13 UTC

[jira] [Resolved] (HIVE-13733) CTE + "IS NULL" predicate + column aliasing as existing column leads to wrong results

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

Pengcheng Xiong resolved HIVE-13733.
------------------------------------
    Resolution: Duplicate

resolved as duplicate of HIVE-13602. Added a test case for CTE as well. Thanks [~jcamachorodriguez] for the investigation!

> CTE + "IS NULL" predicate + column aliasing as existing column leads to wrong results 
> --------------------------------------------------------------------------------------
>
>                 Key: HIVE-13733
>                 URL: https://issues.apache.org/jira/browse/HIVE-13733
>             Project: Hive
>          Issue Type: Bug
>    Affects Versions: 1.1.0
>            Reporter: Dudu Markovitz
>            Assignee: Pengcheng Xiong
>
> hive> create table t (i int,a string,b string);
> hive> insert into t values (1,'hello','world'),(2,'bye',null);
> hive> select * from t where t.b is null;
> 2	bye	NULL
> This is wrong, all 3 columns should return the same value - t.a.
> hive> with cte as (select t.a as a,t.a as b,t.a as c from t where t.b is null) select * from cte;
> bye	NULL	bye
> However, these are right:
> hive> select t.a as a,t.a as b,t.a as c from t where t.b is null;
> bye	bye	bye
> hive> with cte as (select t.a as a,t.a as b,t.a as c from t where t.b is not null) select * from cte;OK
> hello	hello	hello



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