Robotcell opened a new pull request, #1056: URL: https://github.com/apache/incubator-xtable/pull/1056
Fixes #1034 ## What changed `IcebergSchemaSync.sync` now calls `UpdateSchema.setIdentifierFields(latest.identifierFieldNames())` when the identifier fields of the current and latest schema differ. Previously a required record key that became optional was made optional but stayed an identifier field, so Iceberg rejected the commit with `Cannot add field id as an identifier field: not a required field`. When identifier fields are unchanged, nothing new is called. ## Testing - New `testIdentifierFieldsRemovedWhenKeyBecomesOptional` uses a real Iceberg `InMemoryCatalog` table and reproduces the scenario from the issue (required identifier `id` -> optional, no identifiers); it passes. - New `testIdentifierFieldsNotTouchedWhenUnchanged` (mock) passes. - `spotless:check` on `xtable-core` passes (JDK 11). - Ran `mvn -pl xtable-core -am test -Dtest=TestIcebergSchemaSync` on JDK 25: all pass except `testSyncWithProvidedIds`, which fails the same way without my change (Mockito cannot mock `BaseTable` on JDK 25). - NOT run: the full test suite, and the end-to-end Spark/Hudi pluggable-table-format reproduction from the issue. ## AI disclosure Written with AI assistance (Claude Code) and reviewed before committing. Commit is signed off (`-s`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- 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]
