Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-2782: Set struct field optionality in schema evolution #61

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

nicmart
Copy link
Contributor

@nicmart nicmart commented Feb 10, 2024

This is a backport of @afiore's DP-2767 from Kafka EMS Connector 2.0

Background

When running some integration tests using schemaless JSON as input format, we observed a bug where the avro library was complaining due to a nested struct field being set to null (please refer to associated Jira ticket for more details on the failure scenario).

Root cause analysis and fix

The optional schema attribute was lost during the schema evolution, where we mistakenly forgot to set this field. The fix consists of a conditional statement where we set the schema to optional if either the left or the right term of the merge is optional.

Testing

  • Added a test to the StructSchemaEvolutionTest suite where we add coverage for the log detailed above.

@nicmart nicmart merged commit cb95933 into main Feb 13, 2024
11 checks passed
@nicmart nicmart deleted the DP-2782-backport-evolution-bugfix branch February 13, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants