-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[BEAM-9931] Support custom Avro DatumReaders in AvroIO #11641
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
72ccb34 to
c6ae351
Compare
c6ae351 to
9c3a87b
Compare
9c3a87b to
d2ca199
Compare
RyanSkraba
left a comment
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.
LGTM! Thanks for the feature.
| if (codec.equals(DataFileConstants.NULL_CODEC)) { | ||
| // Avro can read from a byte[] using a more efficient implementation. If the input is not | ||
| // compressed, pass the data in directly. | ||
| this.decoder = DecoderFactory.get().binaryDecoder(data, 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.
Nice, avoids the input stream wrapper.
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.
Neat!
iemejia
left a comment
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.
LGTM! Flawless job @steveniemitz Thanks!
| if (codec.equals(DataFileConstants.NULL_CODEC)) { | ||
| // Avro can read from a byte[] using a more efficient implementation. If the input is not | ||
| // compressed, pass the data in directly. | ||
| this.decoder = DecoderFactory.get().binaryDecoder(data, 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.
Neat!
|
thanks for the quick reviews! |
Similar to PR #11479, it would be useful to be able to explicitly pass a DatumReader factory to AvroIO, and have it use that instead of GenericDatumReader or SpecificDatumReader.
This PR adds
withDatumReaderFactoryto AvroIO and plumbs it through into AvroSource.R: @iemejia
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username).[BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replaceBEAM-XXXwith the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
Post-Commit Tests Status (on master branch)
Pre-Commit Tests Status (on master branch)
See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.