UpdateSchema.BuildUpdates should select newly added schemas with schema-id: -1
Maintainers usually reply within 2 days
@nisan1101 is already working on this.
Since Nov 13, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start with UpdateSchema.BuildUpdates() in table/update_schema.go at the cited lines and compare the new-schema branch with the branch that selects an existing schema. Change the new-schema selection to use -1, while retaining the existing explicit ID and AssertCurrentSchemaID requirement; verify that the emitted updates select the schema added by the request.
Written by the indexing model from the issue text.
Description
Apache Iceberg version
v0.7.0 and main (development), checked at 8d13e317c79f36f38f52a16b2f81f1d966f1fc27.
Please describe the bug 🐞
UpdateSchema.BuildUpdates() emits these updates when adding a new schema:
NewAddSchemaUpdate(newSchema),
NewSetCurrentSchemaUpdate(newSchema.ID),
The second update uses a client-predicted schema ID. If another writer registers a different schema between our metadata read and commit, the catalog can assign our schema a different ID, causing set-current-schema to select the other writer's schema.
Reproduction scenario
- A table has current schema ID
0, containing fieldsa,b, andc. - Writer A reads that metadata and uses
UpdateSchema.BuildUpdates()to dropb. Its updates add schema{a, c}and select predicted schema ID1. - Before A commits, writer B registers schema
{a, b}with ID1, without making it current. - A commits its previously built updates.
- The catalog assigns A's schema ID
2, but A'sset-current-schemastill selects ID1.
The commit selects B's schema {a, b} instead of A's intended schema {a, c}.
AssertCurrentSchemaID(0) still passes because B did not change the current schema. Even an additional AssertLastAssignedFieldID requirement does not catch this case because B added no field IDs.
Expected behavior / proposed fix
After adding a new schema, emit:
NewAddSchemaUpdate(newSchema),
NewSetCurrentSchemaUpdate(-1),
The REST Catalog specification defines schema-id as:
Schema ID to set as current, or -1 to set last added schema
Using -1 selects the schema added by this request using its actual assigned ID. The branch that selects an already-existing schema should continue using that schema's explicit ID, and the existing AssertCurrentSchemaID requirement should remain.
- Dominant language
- Go
- Stars
- 477
- Forks
- 262
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 303
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from apache/iceberg-go
-
UpgradeFormatVersion fails when last-column-id is lower than an existing field IDPossibly taken @Shruthirdy claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
apache/iceberg-go#2578 ·
Maintainers usually reply within 2 days
-
RowDelta: concurrent dv conflict returns a plain errorPossibly taken @akritishakya claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
apache/iceberg-go#2491 · 1 comment ·
Maintainers usually reply within 2 days
-
fix(cli): return a clear error for an unknown --output typeMay be free again @eneskeles claimed this 43 days ago, and no pull request is open. Opengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/iceberg-go#2082 · 2 comments · 1 assignee ·
Maintainers usually reply within 2 days
-
TruncateTransform splits multi-byte UTF-8 characters, producing invalid string bounds in manifestsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
apache/iceberg-go#2063 · 3 comments ·
Maintainers usually reply within 2 days
-
rest: a 406 response is not reported as ErrNotImplementedPossibly taken @slachiewicz claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
apache/iceberg-go#2587 ·
Maintainers usually reply within 2 days
All issues in apache/iceberg-go
Similar issues
-
area: interop area: sip-core v3
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
fonoster/routr#705 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
deadfin-org/deadfin#35 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
-
enhancement priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
labmonkeys-space/nl6#1037 ·
Maintainers usually reply within 1 day
-
Setup Guide Go tab: say it needs Go 1.26 (the unversioned go get pulls OpenTelemetry Go v1.47.0)Openenhancement follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day