Zoltán Borók-Nagy created IMPALA-15826:
------------------------------------------
Summary: Iceberg IS NULL push down skips files with TIMESTAMP/DATE
values that Impala reads as NULL
Key: IMPALA-15826
URL: https://issues.apache.org/jira/browse/IMPALA-15826
Project: IMPALA
Issue Type: Bug
Components: Frontend
Reporter: Zoltán Borók-Nagy
Assignee: Zoltán Borók-Nagy
Impala reads TIMESTAMP values before 1400-01-01 and DATE values outside
0001-01-01..9999-12-31 as NULL (with a warning), but the null counts in Iceberg
metadata only count real NULLs. When {{ts IS NULL}} (or {{NOT (ts IS NOT
NULL)}}) is pushed down, Iceberg skips files that only hold such values, so
rows that Impala considers NULL are lost.
Example: an unpartitioned table written by Spark with two Parquet files, one
with ts = '0001-01-01 00:00:00' and '1000-06-01 12:00:00' (null count 0), the
other with '2024-05-01 10:00:00' and NULL. This query returns 3 without push
down and 1 with it:
{code:sql}
SELECT count(*) FROM t WHERE ts IS NULL;
{code}
On master the predicate is only pushed down if the query also has a partition
predicate, IMPALA-15629 makes this the default.
Fix: push down {{ts IS NULL}} as {{isNull(ts) OR ts < min OR ts > max}} with
Impala's valid range, and {{ts IS NOT NULL}} as its negation, so NOT stays
correct.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)