You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hive.apache.org by "Alexey Bedrintsev (JIRA)" <ji...@apache.org> on 2016/12/27 11:31:58 UTC
[jira] [Updated] (HIVE-15517) NOT (x <=> y) returns NULL if x or y
is NULL
[ 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.
> 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
> 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.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)