soumyakanti3578 commented on code in PR #6550: URL: https://github.com/apache/hive/pull/6550#discussion_r3469162696
########## ql/src/test/queries/clientpositive/is_null_is_not_null_nested.q: ########## @@ -0,0 +1,28 @@ +-- Tests for nested IS NULL / IS NOT NULL predicates. +-- (name IS NULL) IS NULL should simplify to FALSE since IS NULL always returns a non-nullable BOOLEAN. +-- (name IS NOT NULL) IS NULL should simplify to FALSE for the same reason. + +CREATE TABLE t_is_null_nested (id INT, name STRING); + +INSERT INTO t_is_null_nested VALUES + (1, 'alice'), + (2, NULL); + +-- always FALSE +SELECT id, (name IS NULL) IS NULL FROM t_is_null_nested ORDER BY id; + +-- always FALSE +SELECT id, (name IS NOT NULL) IS NULL FROM t_is_null_nested ORDER BY id; + +-- always TRUE +SELECT id, (name IS NULL) IS NOT NULL FROM t_is_null_nested ORDER BY id; + +-- always TRUE +SELECT id, (name IS NOT NULL) IS NOT NULL FROM t_is_null_nested ORDER BY id; + +-- no rows should be filtered out +SELECT id FROM t_is_null_nested WHERE (name IS NULL) IS NOT NULL ORDER BY id; + +-- should filter out all rows +SELECT id FROM t_is_null_nested WHERE (name IS NULL) IS NULL ORDER BY id; + Review Comment: Done 👍🏼 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
