Core: Add regression tests for GH-16217 drop partition field + drop column#16234
Open
sshivampeta wants to merge 1 commit intoapache:mainfrom
Open
Conversation
…drop authored-by: Shivakumar Shivampeta
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds core-level regression coverage for #16217, which reports an unrecoverable table state after running DROP PARTITION FIELD followed by DROP COLUMN on an identity-partitioned source column.
What’s covered
.partitions metadata table remains queryable after dropping a partition field and then dropping the former source column.
Re-adding the dropped column name (same column name, new field ID) succeeds after the drop sequence.
Notes / context
The original issue is reported against Iceberg 1.10.1 (Spark 3.5.8). On current main, the core behavior appears fixed; these tests prevent regressions.
This is core-only coverage (no Spark SQL / HMS integration in this PR).
Test plan
./gradlew :iceberg-core:test --tests org.apache.iceberg.TestMetadataTableScansWithPartitionEvolution.testPartitionsTableWithDroppedPartitionSourceColumn
./gradlew :iceberg-core:test --tests org.apache.iceberg.TestMetadataTableScansWithPartitionEvolution.testReAddDroppedPartitionSourceColumnName
Issue link
Relates to #16217.
Files changed
core/src/test/java/org/apache/iceberg/TestMetadataTableScansWithPartitionEvolution.java (adds 2 regression tests)
authored-by: Shivakumar Shivampeta