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

GH-3114: Fix LogicalType conversions for nested records on Avro <= 1.8 #3111

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

clairemcginty
Copy link
Contributor

@clairemcginty clairemcginty commented Jan 2, 2025

Rationale for this change

Fixes logical type conversions for nested records on Avro <= 1.8. This was also addressed in https://github.com/apache/parquet-java/pull/1296/files but was missing the test case where all logical types are in nested classes and there are zero top-level logical types. In this case, invoking clazz.getDeclaredField("conversions") in AvroRecordConverter throws a NoSuchFieldException and terminates the loop before attempting to traverse the record's inner fields.

Fixes #3114

What changes are included in this PR?

Fixes built-in logical type conversions for Avro records that contain only nested logical type fields on <= 1.8

Are these changes tested?

Included a test for the case described above

Are there any user-facing changes?

@clairemcginty
Copy link
Contributor Author

cc @RustedBones can you take a look when you have a chance?

@wgtmac
Copy link
Member

wgtmac commented Jan 5, 2025

Thanks for the fix! Could you please create a Github issue for this and associate with it in the title?

cc @Fokko @gszadovszky as Avro experts.

@clairemcginty clairemcginty changed the title Fix LogicalType conversions for nested records on Avro <= 1.8 GH-3114: Fix LogicalType conversions for nested records on Avro <= 1.8 Jan 6, 2025
Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

This makes sense to me @clairemcginty, thanks for fixing this!

@Fokko Fokko merged commit d6c80d7 into apache:master Jan 14, 2025
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.

Built-in conversions for nested logical types fail on Avro <= 1.8
4 participants