Skip to content

[v26.1.x] iceberg: accept singular "source-id" when parsing sort fields#30477

Merged
mmaslankaprv merged 2 commits into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30475-v26.1.x-937
May 15, 2026
Merged

[v26.1.x] iceberg: accept singular "source-id" when parsing sort fields#30477
mmaslankaprv merged 2 commits into
redpanda-data:v26.1.xfrom
vbotbuildovich:backport-pr-30475-v26.1.x-937

Conversation

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

Backport of PR #30475

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)
@vbotbuildovich vbotbuildovich added this to the v26.1.x-next milestone May 14, 2026
@vbotbuildovich vbotbuildovich added the kind/backport PRs targeting a stable branch label May 14, 2026
@mmaslankaprv mmaslankaprv enabled auto-merge May 15, 2026 09:55
@mmaslankaprv mmaslankaprv merged commit 384ae12 into redpanda-data:v26.1.x May 15, 2026
20 checks passed
@tyson-redpanda tyson-redpanda modified the milestones: v26.1.x-next, v26.1.9 May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/redpanda kind/backport PRs targeting a stable branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants