Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HIVE-28705: Fix Data Inconsistency due to missing 'IS NOT? TRUE/FALSE' parsing in Partition Filter Pruning #5614

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
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;

select id from t1 where month in (3,4) is not true;
select id from t1 where month not in (3,4) is not true;
select id from t1 where month in (3,4) is not false;
select id from t1 where month not in (3,4) is not false;
select id from t1 where month in (3,4) is true;
select id from t1 where month not in (3,4) is true;
select id from t1 where month in (3,4) is false;
select id from t1 where month not in (3,4) 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;

select id from t1 where month in (3,4) is not true;
select id from t1 where month not in (3,4) is not true;
select id from t1 where month in (3,4) is not false;
select id from t1 where month not in (3,4) is not false;
select id from t1 where month in (3,4) is true;
select id from t1 where month not in (3,4) is true;
select id from t1 where month in (3,4) is false;
select id from t1 where month not in (3,4) is false;
Loading
Loading