Impala Public Jenkins has submitted this change and it was merged. ( 
https://gerrit.cloudera.org/25196 )

Change subject: IMPALA-15639: Don't trust the bounds of migrated Iceberg data 
files
......................................................................

IMPALA-15639: Don't trust the bounds of migrated Iceberg data files

ALTER TABLE CONVERT TO ICEBERG gets the metrics of the data files from
Iceberg's TableMigrationUtil, which reads the min/max statistics of
the Parquet footers as if they had the Iceberg type of the column.
This is wrong e.g. for INT64 timestamps with MILLIS or NANOS unit, and
for decimals whose scale was changed in the Hive table before the
migration. Iceberg used these bounds to skip data files with matching
rows when predicates were pushed down.

CONVERT TO ICEBERG now removes the bounds of TIMESTAMP and DECIMAL
columns from the metrics of the imported data files.

Tables that were migrated earlier, or by other engines, still have
such bounds. Imported data files keep their original location, while
Impala and other engines write new data files under the data location
of the table, '<table location>/data' by default. The content file
store now records whether a table has data files outside its data
location, comparing paths without scheme and authority. Only
predicates on identity partition columns of every partition spec are
pushed down to Iceberg for such tables, because data files only have
metrics for these columns if they store them. The restriction goes
away once the imported files are rewritten, e.g. by OPTIMIZE.
Limitations:
 - Time travel to a snapshot that still had imported files is not
   restricted after that.
 - Data files written to an earlier data location of the table, e.g.
   before 'write.data.path' was changed, or by a custom location
   provider, are treated as imported too.

Testing:
 - Added EE tests for migrated tables, with partition evolution,
   appends, data location properties, and before and after OPTIMIZE.
 - Updated a test of a table that has data files in several data
   locations.

Change-Id: Id993ebe1e4c1daed3da1362c6e063c02f9a710d7
Assisted-by: Claude Opus 5.5 (Claude Code)
Reviewed-on: https://gerrit.cloudera.org/25196
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M common/thrift/CatalogObjects.thrift
M fe/src/main/java/org/apache/impala/catalog/IcebergContentFileStore.java
M fe/src/main/java/org/apache/impala/catalog/IcebergFileMetadataLoader.java
M fe/src/main/java/org/apache/impala/planner/IcebergScanPlanner.java
M fe/src/main/java/org/apache/impala/util/MigrateTableUtil.java
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-migrate-from-external-hdfs-tables.test
M 
testdata/workloads/functional-query/queries/QueryTest/iceberg-multiple-storage-locations-table.test
7 files changed, 279 insertions(+), 8 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit https://gerrit.cloudera.org/25196
To unsubscribe, visit https://gerrit.cloudera.org/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id993ebe1e4c1daed3da1362c6e063c02f9a710d7
Gerrit-Change-Number: 25196
Gerrit-PatchSet: 4
Gerrit-Owner: Zoltan Borok-Nagy <[email protected]>
Gerrit-Reviewer: Arnab Karmakar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to