hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Bedrintsev (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HIVE-15517) NOT (x <=> y) returns NULL if x or y is NULL
Date Tue, 27 Dec 2016 11:41:58 GMT

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

Alexey Bedrintsev updated HIVE-15517:
-------------------------------------
    Description: 
I created a table as following:

create table test(x string, y string);
insert into test values ('q', 'q'), ('q', 'w'), (NULL, 'q'), ('q', NULL), (NULL, NULL);

Then I try to compare values taking NULLs into account:

select *, x<=>y, not (x<=> y), (x <=> y) = false from test;
OK
q       q       true    false   false
q       w       false   true    true
q       NULL    false   NULL    true
NULL    q       false   NULL    true
NULL    NULL    true    NULL    false

I expected that 4th column will be the same as 5th one but actually got NULL as result of
"not false" and "not true" expressions.

Hive 1.2.1000.2.5.0.0-1245
Subversion git://c66-slave-20176e25-3/grid/0/jenkins/workspace/HDP-parallel-centos6/SOURCES/hive
-r da6c690d384d1666f5a5f450be5cbc54e2fe4bd6
Compiled by jenkins on Fri Aug 26 01:39:52 UTC 2016
>From source with checksum c30648316a632f7a753f4359e5c8f4d6

  was:
I created a table as following:

create table test(x string, y string);
insert into test values ('q', 'q'), ('q', 'w'), (NULL, 'q'), ('q', NULL), (NULL, NULL);

Then I try to compare values taking NULLs into account:

select *, x<=>y, not (x<=> y), (x <=> y) = false from test;
OK
q       q       true    false   false
q       w       false   true    true
q       NULL    false   NULL    true
NULL    q       false   NULL    true
NULL    NULL    true    NULL    false

I expected that 4th column will be the same as 5th one but actually got NULL as result of
"not false" and "not true" expressions.


> NOT (x <=> y) returns NULL if x or y is NULL
> --------------------------------------------
>
>                 Key: HIVE-15517
>                 URL: https://issues.apache.org/jira/browse/HIVE-15517
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive, Operators, Query Processor, SQL
>    Affects Versions: 1.2.1
>            Reporter: Alexey Bedrintsev
>
> I created a table as following:
> create table test(x string, y string);
> insert into test values ('q', 'q'), ('q', 'w'), (NULL, 'q'), ('q', NULL), (NULL, NULL);
> Then I try to compare values taking NULLs into account:
> select *, x<=>y, not (x<=> y), (x <=> y) = false from test;
> OK
> q       q       true    false   false
> q       w       false   true    true
> q       NULL    false   NULL    true
> NULL    q       false   NULL    true
> NULL    NULL    true    NULL    false
> I expected that 4th column will be the same as 5th one but actually got NULL as result
of "not false" and "not true" expressions.
> Hive 1.2.1000.2.5.0.0-1245
> Subversion git://c66-slave-20176e25-3/grid/0/jenkins/workspace/HDP-parallel-centos6/SOURCES/hive
-r da6c690d384d1666f5a5f450be5cbc54e2fe4bd6
> Compiled by jenkins on Fri Aug 26 01:39:52 UTC 2016
> From source with checksum c30648316a632f7a753f4359e5c8f4d6



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

Mime
View raw message