Hello Peter Rozsa, Noemi Pap-Takacs, Impala Public Jenkins,
I'd like you to reexamine a change. Please visit
https://gerrit.cloudera.org/25276
to look at the new patch set (#4).
Change subject: IMPALA-15730: Fix DROP PARTITION dropping other Iceberg
partitions
......................................................................
IMPALA-15730: Fix DROP PARTITION dropping other Iceberg partitions
ALTER TABLE DROP PARTITION on an Iceberg table truncated the table if
the selected data and delete files were as many as the files in the
snapshot summary. The truncate could drop files that the statement did
not select:
- A delete file that applies to several selected data files was
counted once for each of them, so a partial drop could truncate the
table.
- The truncate was decided on the snapshot of the analysis, but
catalogd committed deleteFromRowFilter(alwaysTrue()), which also
drops the files committed in between, in any partition, and is
applied again when Iceberg retries the commit.
Without the truncate, catalogd deleted the selected paths without
validating them, so if a concurrent OPTIMIZE had rewritten a selected
file, the rewritten rows stayed in the table.
The truncate shortcut is removed. The analysis sends the set of the
selected data file paths, and catalogd deletes them with
validateFilesExist(): files committed concurrently are kept, and the
commit fails if a selected file is gone. Delete file paths are not
sent, as DeleteFiles.deleteFile() ignores them and the validation would
fail on them. TIcebergDropPartitionRequest.is_truncate and
FeIcebergTable.Utils.getTotalNumberOfFiles() are removed.
Iceberg drops the deletion vectors of the dropped data files, but
delete files of format version 2 can stay in the table, also if every
partition is dropped. They don't change the results; dropping them is
tracked in IMPALA-15483.
Testing:
- Added EE tests that drop partitions with a delete file that applies
to two data files (format version 2, and upgraded to 3), with
deletion vectors, and every partition at once.
- test_drop_partition, test_rollback_after_drop_partition,
test_partitions, test_null_partition_predicates,
test_missing_data_files, test_iceberg_uuid_type, test_optimize*,
test_column_case_sensitivity, test_iceberg_alter_and_insert and
AnalyzeDDLTest#TestAlterTableAddDropPartition pass.
Change-Id: I47dd166a468f1ae038c36e052cfe24fbb9932a3c
Assisted-by: Claude Opus 5.5 (Claude Code)
---
M common/thrift/CatalogObjects.thrift
M fe/src/main/java/org/apache/impala/analysis/AlterTableDropPartitionStmt.java
M fe/src/main/java/org/apache/impala/catalog/FeIcebergTable.java
M fe/src/main/java/org/apache/impala/service/IcebergCatalogOpExecutor.java
M
testdata/workloads/functional-query/queries/QueryTest/iceberg-drop-partition.test
5 files changed, 125 insertions(+), 67 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/76/25276/4
--
To view, visit https://gerrit.cloudera.org/25276
To unsubscribe, visit https://gerrit.cloudera.org/settings
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I47dd166a468f1ae038c36e052cfe24fbb9932a3c
Gerrit-Change-Number: 25276
Gerrit-PatchSet: 4
Gerrit-Owner: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Nandor Kollar <[email protected]>
Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]>
Gerrit-Reviewer: Peter Rozsa <[email protected]>