Skip to content

Core: Fix SerializableTable.sortOrders() throwing on historical sort orders with dropped fields (#16519)#16521

Open
MonkeyCanCode wants to merge 2 commits into
apache:mainfrom
MonkeyCanCode:fix_16519
Open

Core: Fix SerializableTable.sortOrders() throwing on historical sort orders with dropped fields (#16519)#16521
MonkeyCanCode wants to merge 2 commits into
apache:mainfrom
MonkeyCanCode:fix_16519

Conversation

@MonkeyCanCode
Copy link
Copy Markdown

Background

After upgraded Apache Iceberg runtime from 1.10.1 to 1.11.0, the write from spark on my workload started to fail when the table has a historical sort order that references a column that has since been dropped from the schema. This is introduced by #15150. This is also reported by @aihuaxu via #16519

Change

SerializableTable.sortOrders() strict binds every sort order against the current schema, which fails when a historical sort order references a field dropped by schema evolution. This PR fixes it to only strict bind the default sort order.

Test Plan

I added the new test case added by @aihuaxu from #16519 as well as the local reproducible that I wrote to validate the issue is resolved by this PR.

@github-actions github-actions Bot added the core label May 22, 2026
@MonkeyCanCode MonkeyCanCode changed the title Fix SerializableTable.sortOrders() throwing on historical sort orders with dropped fields (#16519) Core: Fix SerializableTable.sortOrders() throwing on historical sort orders with dropped fields (#16519) May 22, 2026
@MonkeyCanCode
Copy link
Copy Markdown
Author

@aihuaxu mind take a look?

Comment thread core/src/main/java/org/apache/iceberg/SortOrderParser.java Outdated
Comment thread core/src/test/java/org/apache/iceberg/hadoop/TestTableSerialization.java Outdated
@MonkeyCanCode
Copy link
Copy Markdown
Author

Thanks for the quick review @anuragmantri . Mind take another look?

@MonkeyCanCode
Copy link
Copy Markdown
Author

@RussellSpitzer mind take a look if this is okay to proceed?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants