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


Change subject: IMPALA-15794: Fix the Iceberg metrics of FLOAT and DOUBLE 
columns
......................................................................

IMPALA-15794: Fix the Iceberg metrics of FLOAT and DOUBLE columns

Iceberg keeps NaNs out of the lower and upper bounds of data files and
counts them in nan_value_counts. Its readers assume that a file without
NaN value counts has no NaNs, and it orders -0.0 before 0.0. Impala
wrote no NaN value counts, while it left NaNs out of the bounds, so
Iceberg skipped e.g. a file with 1 and NaN for 'd != 1', and its
StrictMetricsEvaluator, which Spark uses to delete whole files, said
that all rows of the file match 'd = 1'. When -0.0 and 0.0 tied, fmin()
and fmax() returned either of them, so the upper bound could be -0.0
while the file had 0.0, and Iceberg skipped the file for 'd = 0'. If all
values were NaN, the bounds were NaN, which the Iceberg spec doesn't
allow.

The Parquet writer now counts NaNs in the column stats of FLOAT and
DOUBLE columns, and the catalog sets them as the NaN value counts of the
data files. When -0.0 and 0.0 tie, the minimum is -0.0 and the maximum
is 0.0, also in the Parquet statistics and page indexes. Iceberg
metrics have no bounds for columns whose values are all NaN.

Impala still doesn't push down != and NOT IN on floating-point columns
(IMPALA-15635), because data files written earlier have no NaN counts.

Testing:
 - Added BE tests for the Iceberg stats of FLOAT and DOUBLE columns.
 - Added an EE test for the metrics of the written data files.

Change-Id: Ifb0bdb1d4e28bd70ea204937675fd6f15a2c1db1
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M be/src/exec/hdfs-table-writer.h
M be/src/exec/parquet/CMakeLists.txt
M be/src/exec/parquet/parquet-column-stats-test.cc
M be/src/exec/parquet/parquet-column-stats.h
M be/src/exec/parquet/parquet-column-stats.inline.h
M be/src/runtime/dml-exec-state.cc
M common/fbs/IcebergObjects.fbs
M fe/src/main/java/org/apache/impala/common/IcebergPredicateConverter.java
M fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-predicate-push-down-float.test
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-upper-lower-bound-metrics.test
11 files changed, 198 insertions(+), 12 deletions(-)



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

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

Reply via email to