Indhumathi27 commented on code in PR #5614: URL: https://github.com/apache/hive/pull/5614#discussion_r1946765616
########## ql/src/test/queries/clientpositive/casewhen_isnot_boolean_partition.q: ########## @@ -0,0 +1,77 @@ +create table t1(id int) partitioned by (month int, year string); +insert into t1 select 2,2,'2020'; +insert into t1 select 3,3,'2024'; +insert into t1 select 4,4,'2020'; + +select id from t1 where (CASE WHEN (month=3) THEN true else false END); +select id from t1 where (CASE WHEN (month=3) THEN false else true END); +select id from t1 where (CASE WHEN (year='2024') THEN true else false END); +select id from t1 where (CASE WHEN (year='2024') THEN false else true END); + +select id from t1 where (CASE WHEN (month=3 and year='2024') THEN true else false END); +select id from t1 where (CASE WHEN (month=3 and year='2024') THEN false else true END); + +select id from t1 where (CASE WHEN (month=3 or month=4) THEN true else false END); +select id from t1 where (CASE WHEN (month=3 or month=4) THEN false else true END); + +select id from t1 where (month=3) is not true; +select id from t1 where (month=3) is true; +select id from t1 where (month=3) is not false; +select id from t1 where (month=3) is false; + +select id from t1 where (month=3 or month=4) is not true; +select id from t1 where (month=3 or month=4) is true; +select id from t1 where (month=3 or month=4) is not false; +select id from t1 where (month=3 or month=4) is false; + +select id from t1 where (month=3 and id=3) is not true; +select id from t1 where (month=3 and id=3) is true; +select id from t1 where (month=3 and id=3) is not false; +select id from t1 where (month=3 and id=3) is false; + +select id from t1 where (month=3) and (id=3) is not true; +select id from t1 where (month=3) and (id=3) is true; +select id from t1 where (month=3) and (id=3) is not false; +select id from t1 where (month=3) and (id=3) is false; + +select id from t1 where ((month=3 or month=4) and year='2024') is not true; +select id from t1 where ((month=3 or month=4) and year='2024') is true; +select id from t1 where ((month=3 or month=4) and year='2024') is not false; +select id from t1 where ((month=3 or month=4) and year='2024') is false; + +set hive.cbo.enable=false; +select id from t1 where (CASE WHEN (month=3) THEN true else false END); +select id from t1 where (CASE WHEN (month=3) THEN false else true END); +select id from t1 where (CASE WHEN (year='2024') THEN true else false END); +select id from t1 where (CASE WHEN (year='2024') THEN false else true END); + +select id from t1 where (CASE WHEN (month=3 and year='2024') THEN true else false END); +select id from t1 where (CASE WHEN (month=3 and year='2024') THEN false else true END); + +select id from t1 where (CASE WHEN (month=3 or month=4) THEN true else false END); +select id from t1 where (CASE WHEN (month=3 or month=4) THEN false else true END); + +select id from t1 where (month=3) is not true; +select id from t1 where (month=3) is true; +select id from t1 where (month=3) is not false; +select id from t1 where (month=3) is false; + +select id from t1 where (month=3 or month=4) is not true; +select id from t1 where (month=3 or month=4) is true; +select id from t1 where (month=3 or month=4) is not false; +select id from t1 where (month=3 or month=4) is false; + +select id from t1 where (month=3 and id=3) is not true; +select id from t1 where (month=3 and id=3) is true; +select id from t1 where (month=3 and id=3) is not false; +select id from t1 where (month=3 and id=3) is false; + +select id from t1 where (month=3) and (id=3) is not true; +select id from t1 where (month=3) and (id=3) is true; +select id from t1 where (month=3) and (id=3) is not false; +select id from t1 where (month=3) and (id=3) is false; + +select id from t1 where ((month=3 or month=4) and year='2024') is not true; +select id from t1 where ((month=3 or month=4) and year='2024') is true; +select id from t1 where ((month=3 or month=4) and year='2024') is not false; +select id from t1 where ((month=3 or month=4) and year='2024') is false; Review Comment: CASE WHEN (month=3 or month=4) THEN true else false END) - this case will cover this scenario. It is added in the qfile -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org