Carter Shanklin created HIVE-14838:
--------------------------------------

             Summary: F481: Expanded NULL Predicate
                 Key: HIVE-14838
                 URL: https://issues.apache.org/jira/browse/HIVE-14838
             Project: Hive
          Issue Type: Sub-task
            Reporter: Carter Shanklin


F481 is mandatory in the SQL spec. In the context of comparisons to null and 
not null "The <row value expression> can be something other than a <column 
reference>". Essentially a full row / tuple can be compared against null.

An example in Postgres:
{code}
vagrant=# create table test (x int, y int, z int);
vagrant=# insert into test values (1, 1, 1);
vagrant=# insert into test values (2, 2, 2);
vagrant=# insert into test values (null, 3, null);
vagrant=# insert into test values (4, null, null);
vagrant=# insert into test values (null, null, null);

vagrant=# select * from test where (x, z) is null;
 x | y | z
---+---+---
   | 3 |
   |   |
(2 rows)

vagrant=# select * from test where (x, z) is not null;
 x | y | z
---+---+---
 1 | 1 | 1
 2 | 2 | 2
{code}

Hive currently produces a parse error for these queries.



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

Reply via email to