Skip to content

HIVE-29808: Iceberg: Add guardrails to compaction with schema evolution - #6690

Open
difin wants to merge 1 commit into
apache:masterfrom
difin:guardrails_schema_evolution
Open

HIVE-29808: Iceberg: Add guardrails to compaction with schema evolution#6690
difin wants to merge 1 commit into
apache:masterfrom
difin:guardrails_schema_evolution

Conversation

@difin

@difin difin commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Added guardrails for Iceberg partition-scoped compaction on tables that have undergone partition spec evolution, where the same partition path can match more than one historical spec. This scenario is possible with partition schema evolution with Iceberg v1 tables. Also, added more tests for partition schema evolution that cover the following cases: unpartitioned to partitioned , spec change, back to unpartitioned.

Why are the changes needed?

Iceberg compaction matches partitions by path and with Iceberg v1 tables that undergone partition schema evolution this can cause issues.

Does this PR introduce any user-facing change?

Yes, Iceberg compaction may be refused for Iceberg v1 tables that undergone partition schema evolution in case more than one partition matches the same path.

How was this patch tested?

Added more partition evolution cases to existing q-tests; Added new test class TestIcebergTableUtil that tests IcebergTableUtil.getPartitionSpec() against a real v1 Iceberg table built with HadoopTables and evolved via the Iceberg API: ambiguous resolution after repeated spec changes (identity → unpartitioned → identity), a unique match after a single spec change, and failure when no spec matches the partition path.

@difin
difin force-pushed the guardrails_schema_evolution branch from 20c52f1 to 43c624a Compare August 12, 2026 22:21
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants