Repository navigation
Conversation
IcebergSchemaSync made a required column optional but left it in the identifier fields, so the schema commit failed with 'Cannot add field id as an identifier field: not a required field'. Sync the identifier fields with the latest schema whenever they differ. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Robotcell <105160953+Robotcell@users.noreply.github.com>
Author
|
Closing this PR: it turns out the project's contribution policy doesn't accept commits prepared with AI assistance (or requires line-by-line human review), which I can't satisfy. Sorry for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1034
What is the purpose of the pull request
Fix the Iceberg schema sync failure
Cannot add field id as an identifier field: not a required fieldthat happens when a required record key of an existing Iceberg target becomes nullable.IcebergSchemaSyncmade the column optional but left it in the identifier fields.Brief change log
IcebergSchemaSync.synccallsUpdateSchema.setIdentifierFields(latest.identifierFieldNames())when the identifier fields of the current and latest schema differ. Nothing new is called when they are unchanged.testIdentifierFieldsRemovedWhenKeyBecomesOptional(real IcebergInMemoryCatalogtable, reproduces the issue scenario) andtestIdentifierFieldsNotTouchedWhenUnchanged(mock) toTestIcebergSchemaSync.Verify this pull request
This change added tests and can be verified as follows:
mvn -pl xtable-core -am test -Dtest=TestIcebergSchemaSync(JDK 25): the new tests pass.testSyncWithProvidedIdsfails the same way without my change (Mockito cannot mockBaseTableon JDK 25).spotless:checkonxtable-corepasses (JDK 11).-s). It has noGenerated-bytoken (recommended, not required, by the ASF generative tooling guidance); I can add one on request.AI disclosure
This change was prepared with Claude Code (AI assistance) and verified by running the project's tests/CI. The account owner did not review the code line by line.
🤖 Generated with Claude Code