Daniel Vanko has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/24688


Change subject: IMPALA-14397: Enhance IcebergPredicateConverter for reversed IN 
predicates
......................................................................

IMPALA-14397: Enhance IcebergPredicateConverter for reversed IN predicates

Reversed IN predicates of the form 'literal IN (col_a, col_b)' (literal
on the left, columns in the list) were not recognized by
IcebergPredicateConverter, which assumes the first child of an IN
predicate is a column. The predicate was therefore dropped during
planning, forcing a full table scan instead of pruning partitions.

Detect the reversed form (first child is a literal) and translate it to
an equivalent compound Iceberg expression:
  'lit IN (a, b)'     -> a = lit OR b = lit
  'lit NOT IN (a, b)' -> a != lit AND b != lit
Both are equivalent to the original under three-valued (NULL) logic, so
the result is FULLY_CONVERTED. List columns whose types differ (and thus
receive an implicit cast) are left untranslated and fall back to
Impala-side evaluation, as before.

This enables Iceberg partition pruning for the reversed form. Using the
resulting OR predicate for Parquet row-group filtering on non-partition
columns is tracked separately by IMPALA-12157.

Testing:
- Added e2e cases to iceberg-in-predicate-push-down.test covering
  reversed IN / NOT IN on partition columns (metadata-only pruning),
  regular columns, and the mixed-type fallback.
- Added planner cases to iceberg-predicates.test.

Change-Id: Ieda3623a5e7fdc9c1b50abbd9426a15e973b5cc9
Assisted-by: Claude Opus 4.8 (Claude Code)
---
M fe/src/main/java/org/apache/impala/common/IcebergPredicateConverter.java
M 
testdata/workloads/functional-planner/queries/PlannerTest/iceberg-predicates.test
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-in-predicate-push-down.test
3 files changed, 124 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/88/24688/1
--
To view, visit http://gerrit.cloudera.org:8080/24688
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ieda3623a5e7fdc9c1b50abbd9426a15e973b5cc9
Gerrit-Change-Number: 24688
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Vanko <[email protected]>

Reply via email to