Zoltan Borok-Nagy has uploaded this change for review. ( 
https://gerrit.cloudera.org/25570


Change subject: IMPALA-15826: Fix Iceberg IS NULL push-down on TIMESTAMP and 
DATE
......................................................................

IMPALA-15826: Fix Iceberg IS NULL push-down on TIMESTAMP and DATE

Impala reads TIMESTAMP values outside 1400-01-01..9999-12-31 and DATE
values outside 0001-01-01..9999-12-31 as NULL, but the null counts of
Iceberg data files only count real NULLs. When 'ts IS NULL' was pushed
down, Iceberg skipped the data files that only had such values.

IS NULL on these types is now pushed down as
'ts IS NULL OR ts < min OR ts > max', and IS NOT NULL as its negation.
The values of timestamptz columns are converted to the session time
zone, which can move them out of the range. For these columns the
range is widened by a day, Impala evaluates the predicates too, and
NOT isn't pushed down over them. The partition predicates of DDL
statements are evaluated on partition values, so they don't change.

Testing:
 - Added FE tests for the pushed-down predicates.
 - Added an EE test with a Spark-written table. It runs without
   codegen, because codegen'd scans don't read some out-of-range DATE
   and timestamptz values as NULL (IMPALA-15847, IMPALA-7862).

Change-Id: I92245863e2187d6b82f02a3b81190ea108ae4739
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M 
fe/src/main/java/org/apache/impala/common/IcebergPartitionPredicateConverter.java
M fe/src/main/java/org/apache/impala/common/IcebergPredicateConverter.java
M fe/src/test/java/org/apache/impala/common/IcebergPredicateConverterTest.java
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/data/00000-0-d5978e54-0927-4e63-ab06-d8118a156733-0-00001.parquet
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/data/00000-1-50ea3c31-40f0-4798-b6f6-066d721dae0d-0-00001.parquet
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/5030ddb8-64fa-4304-9b84-e349dc03d578-m0.avro
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/701c2306-d3e8-4505-8ed1-297b4e9fa37a-m0.avro
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/snap-2657091061658305988-1-5030ddb8-64fa-4304-9b84-e349dc03d578.avro
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/snap-8774496200384248424-1-701c2306-d3e8-4505-8ed1-297b4e9fa37a.avro
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/v1.metadata.json
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/v2.metadata.json
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/v3.metadata.json
A 
testdata/data/iceberg_test/iceberg_out_of_range_temporal/metadata/version-hint.text
A 
testdata/workloads/functional-query/queries/QueryTest/iceberg-is-null-out-of-range-temporal.test
M tests/query_test/test_iceberg.py
15 files changed, 361 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/70/25570/1
--
To view, visit https://gerrit.cloudera.org/25570
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I92245863e2187d6b82f02a3b81190ea108ae4739
Gerrit-Change-Number: 25570
Gerrit-PatchSet: 1
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>

Reply via email to