[v26.1.x] iceberg: accept singular "source-id" when parsing sort fields#30477
Merged
mmaslankaprv merged 2 commits intoMay 15, 2026
Merged
Conversation
The Iceberg spec defines a sort field's column reference as a single "source-id" int, but our parser only accepted a "source-ids" array. This caused parse_table_meta to reject metadata produced by spec-conformant catalogs (e.g. Unity Catalog) whose sort orders use the singular form. Try the singular "source-id" first and fall back to the "source-ids" array so we remain backwards-compatible with our own writer. The integer validation is also pulled out into a small helper in the anonymous namespace to avoid duplicating the error path. (cherry picked from commit 05d0739)
The existing fixtures only exercise the "source-ids" array form, so the singular "source-id" path added in the previous commit had no coverage. Add two direct parse_sort_field tests: one for the spec-canonical singular form and one verifying a non-int value throws. (cherry picked from commit c416108)
mmaslankaprv
approved these changes
May 15, 2026
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.
Backport of PR #30475