minleejae opened a new pull request, #16927: URL: https://github.com/apache/iceberg/pull/16927
## 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. ## 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 --console=plain --warning-mode=none` - `JAVA_HOME=$(/usr/libexec/java_home -v 21) ./gradlew :iceberg-core:spotlessJavaCheck --console=plain --warning-mode=none` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
