Skip to content

Core: stop serializing deprecated schema last column id - #16927

Closed
minleejae wants to merge 1 commit into
apache:mainfrom
minleejae:fix-add-schema-last-column-id
Closed

Core: stop serializing deprecated schema last column id#16927
minleejae wants to merge 1 commit into
apache:mainfrom
minleejae:fix-add-schema-last-column-id

Conversation

@minleejae

@minleejae minleejae commented Jun 22, 2026

Copy link
Copy Markdown

Why

AddSchemaUpdate.last-column-id is deprecated and optional in the REST OpenAPI spec. Java already ignores this field when parsing add-schema updates and computes the table-level last column ID internally.

However, Java still serializes the deprecated field using schema.highestFieldId(). After dropping the column with the highest field ID, this value can decrease even though table metadata last-column-id must not decrease. REST catalog implementations that validate the deprecated request field can reject otherwise valid schema evolution updates, as reported in #13850.

This does not remove table metadata last-column-id; it only stops sending the deprecated optional field in AddSchemaUpdate. Field-id conflict validation is still carried by AssertLastAssignedFieldId requirements.

Compatibility notes

Catalogs that still send the deprecated field remain supported because parsing is unchanged. The omission path is part of the REST contract; server implementations that need the table-level last assigned field ID should use existing table metadata and/or AssertLastAssignedFieldId requirements rather than depending on the deprecated AddSchemaUpdate field.

What changed

  • Stop serializing deprecated last-column-id for add-schema metadata updates.
  • Keep parsing legacy payloads that still include last-column-id.
  • Add request serialization coverage for an add-schema update representing the schema after dropping the highest field ID.

Testing

  • JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :iceberg-core:test --tests org.apache.iceberg.TestMetadataUpdateParser --tests org.apache.iceberg.rest.requests.TestUpdateTableRequestParser --tests org.apache.iceberg.rest.TestCatalogHandlers --console=plain --warning-mode=none
  • JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :iceberg-core:spotlessJavaCheck --console=plain --warning-mode=none

@github-actions github-actions Bot added the core label Jun 22, 2026
@minleejae
minleejae force-pushed the fix-add-schema-last-column-id branch from dbfc716 to 5f1536b Compare June 22, 2026 10:34
@minleejae

Copy link
Copy Markdown
Author

Hi @Fokko, could you take a look when you have a chance?

I think this is a follow-up to #11514 and #13850. The original direction was to stop exposing AddSchemaUpdate.last-column-id, but the Java serializer still sends the
deprecated optional field using schema.highestFieldId(). That can be incorrect after dropping the column with the highest field ID.

I added a REST server apply-path test to verify that omitting the field preserves the table-level last-column-id.

@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions github-actions Bot added the stale label Jul 24, 2026
@github-actions

Copy link
Copy Markdown

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions Bot closed this Jul 31, 2026
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.

1 participant