Hello Arnab Karmakar, Noemi Pap-Takacs, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
https://gerrit.cloudera.org/25425
to look at the new patch set (#10).
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 neither the Iceberg nor the
Parquet spec allows.
The Parquet writer now counts NaNs in the column stats of FLOAT and
DOUBLE columns. The catalog sets them as the NaN value counts of the
data files, and the Parquet statistics have them as nan_count. When
-0.0 and 0.0 tie, the lower bound of the Iceberg metrics is -0.0 and
the upper bound is 0.0. As the Parquet spec says, the Parquet statistics
and page indexes write any zero minimum as -0.0 and any zero maximum as
0.0. Neither the Iceberg metrics nor the Parquet statistics have 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 and Parquet stats of FLOAT and DOUBLE
columns.
- Added EE tests for the Iceberg metrics, Parquet statistics and page
indexes 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/hdfs-parquet-table-writer.cc
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 fe/src/test/java/org/apache/impala/planner/CardinalityTest.java
M
java/calcite-planner/src/test/java/org/apache/impala/calcite/planner/TestCalciteStats.java
M testdata/workloads/functional-planner/queries/PlannerTest/pivot-clause.test
M testdata/workloads/functional-planner/queries/PlannerTest/unpivot-clause.test
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
M tests/query_test/test_parquet_page_index.py
17 files changed, 363 insertions(+), 48 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/25/25425/10
--
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: newpatchset
Gerrit-Change-Id: Ifb0bdb1d4e28bd70ea204937675fd6f15a2c1db1
Gerrit-Change-Number: 25425
Gerrit-PatchSet: 10
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>