-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Use Avro 1.8-compatible Schema constructors in Storage Write API translator #34281
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
Conversation
@@ -350,10 +350,11 @@ private static TableFieldSchema fieldDescriptorFromAvroField(org.apache.avro.Sch | |||
throw new RuntimeException("Unexpected null element type!"); | |||
} | |||
TableFieldSchema keyFieldSchema = | |||
fieldDescriptorFromAvroField(new Schema.Field("key", keyType, "key of the map entry")); | |||
fieldDescriptorFromAvroField( | |||
new Schema.Field("key", keyType, "key of the map entry", null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a null
value is what Avro 1.11 defaults to, so there's no behavior change here: https://github.com/apache/avro/blob/release-1.11.4/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L588-L589
Thanks, could be a follow up, wondering if we should add a Line 415 in bdb2693
|
Yeah that's a good idea! I'm not sure if I have bandwidth to add it to this PR, but could maybe follow up in a week or so. |
Assigning reviewers. If you would like to opt out of this review, comment R: @kennknowles for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
thanks @Abacn ! just for my planning, do you think this will make it into 2.64 release? |
Schema.Field
in Avro 1.8 doesn't support the three-arg constructor that's available in 1.11:https://github.com/apache/avro/blob/release-1.8.2/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L393-L424
vs
https://github.com/apache/avro/blob/release-1.11.4/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L588-L589
Switching to the four-arg constructor makes the storage write API compatible for Avro 1.8 through Avro 1.11.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123
), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>
instead.CHANGES.md
with noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.