Noemi Pap-Takacs has uploaded this change for review. ( 
http://gerrit.cloudera.org:8080/24927


Change subject: IMPALA-15409: Fix file paths in OPTIMIZE and replace deprecated 
ContentFile.path()
......................................................................

IMPALA-15409: Fix file paths in OPTIMIZE and replace deprecated 
ContentFile.path()

OptimizeStmt with file filtering sends the paths of the selected
data files to the catalog, which matches them against the
DataFile locations to decide which files need to be replaced.

With a partition value containing '/', '"' or '=', no path matched
and OPTIMIZE failed with "Files to delete cannot be empty".
It was a hidden bug because every existing OPTIMIZE test used
plain ASCII partition values.

Using ContentFile.location() to retrieve the paths fixes the issue.

This patch also replaces the now deprecated Iceberg
ContentFile.path() calls with ContentFile.location() throughout
the frontend.

Testing:
 - new e2e test test_optimize_special_char_partitions
 - new IcebergFileFilterTest.testEscapedPartitionPaths, ensuring that
   the filter returns escaped location() strings unchanged.

Change-Id: Ia6df5387f520acd556468ee888c127d99f8fc00d
Assisted-by: Claude Opus 5 (Claude Code)
---
M fe/src/main/java/org/apache/impala/analysis/AlterTableDropPartitionStmt.java
M fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java
M fe/src/main/java/org/apache/impala/analysis/ShowFilesStmt.java
M fe/src/main/java/org/apache/impala/catalog/FeIcebergTable.java
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/service/IcebergCatalogOpExecutor.java
M fe/src/main/java/org/apache/impala/util/IcebergUtil.java
M fe/src/test/java/org/apache/impala/util/IcebergFileFilterTest.java
M tests/query_test/test_iceberg.py
11 files changed, 89 insertions(+), 37 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/27/24927/2
--
To view, visit http://gerrit.cloudera.org:8080/24927
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6df5387f520acd556468ee888c127d99f8fc00d
Gerrit-Change-Number: 24927
Gerrit-PatchSet: 2
Gerrit-Owner: Noemi Pap-Takacs <[email protected]>

Reply via email to