IMPALA-11323: Don't evaluate constants-only inferred predicates

IMPALA-10182 fixed the problem of creating inferred predicates when
both sides of an equality predicate came from the same slot.

Inferred predicates also should not be created when both sides
of an equality predicate are constant values which do not have
scan slots.

Change-Id: If1cd4559dda406d2d38703ed594b70b41ed336fd
Reviewed-on: http://gerrit.cloudera.org:8080/18579
Tested-by: Impala Public Jenkins <impala-public-jenkins@cloudera.com>
Reviewed-by: Aman Sinha <amsinha@cloudera.com>
This commit is contained in:
Steve Carlin
2022-06-01 12:29:56 -07:00
committed by Aman Sinha
parent a57c9e0b9a
commit 13bbff4e4e
3 changed files with 62 additions and 14 deletions

View File

@@ -578,4 +578,18 @@ NULL,NULL
NULL,NULL
---- TYPES
INT, INT
====
====
---- QUERY
# IMPALA-11323: Constant expressions should get filtered out so they
# don't get placed in the select node in the planner.
with t as (select 1 a), v as
(select distinct a, cast(null as smallint) b, cast(null as smallint) c from t)
select distinct a,b,c from v
union all
select distinct a,b,c from v;
---- RESULTS
1,NULL,NULL
1,NULL,NULL
---- TYPES
TINYINT, SMALLINT, SMALLINT
====