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

Use valid schema for Fixed field when deserializing data #566

Merged
merged 2 commits into from
Dec 6, 2024

Conversation

nisargthakkar
Copy link
Contributor

@nisargthakkar nisargthakkar commented Dec 6, 2024

When reader and writer schemas are different for fields of type Fixed, the deserialized objects are created with null schema. This commit fixes that handling and adds a test case for it

Without the fix, the generated class has this:

topLevelRecord.put(0, new org.apache.avro.generic.GenericData.Fixed(null, fixedType0));

With the fix, the generated class has this:

topLevelRecord.put(0, new org.apache.avro.generic.GenericData.Fixed(fixedField0, fixedType0));

Copy link

@ZacAttack ZacAttack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Copy link
Collaborator

@FelixGV FelixGV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Just a couple of minor comments.

Copy link
Collaborator

@FelixGV FelixGV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM! 🚀 🚢

@FelixGV FelixGV merged commit 997baf1 into linkedin:master Dec 6, 2024
2 checks passed
@nisargthakkar nisargthakkar deleted the schemaForFixedField branch December 6, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants