-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 avro DataFileReader to read avro container files #23214
Conversation
Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment |
Run Java_PVR_Flink_Docker PreCommit |
Run Kotlin_Examples PreCommit |
Assigning reviewers. If you would like to opt out of this review, comment R: @lukecwik for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
Assigning reviewers. If you would like to opt out of this review, comment R: @lukecwik for label java. Available commands:
The PR bot will only process comments in the main thread (not review comments). |
ping @iemejia |
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 Really nice simplification/reuse. (My excuses for the delay to do the review).
throw new IllegalArgumentException("Unsupported codec: " + codec); | ||
} | ||
} | ||
private final long numRecordsInBlock; |
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.
Much better name 👍
// Initialized in startReading. | ||
private @Nullable AvroMetadata metadata; | ||
|
||
private static class SeekableChannelInput implements SeekableInput { |
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 pity this one does not exist in Avro
@@ -717,71 +678,25 @@ public synchronized AvroSource<T> getCurrentSource() { | |||
// | |||
// Postcondition: same as above, but for the new current (formerly next) block. | |||
@Override | |||
public boolean readNextBlock() throws IOException { | |||
long startOfNextBlock; | |||
synchronized (progressLock) { |
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.
👍
This fixes #23213
This refactors AvroSource to use the standard DataFileReader from Avro. I don't really have the context around why a custom file parser was written in beam for this, but the code is so old I assume that DataFileReader couldn't properly support reading from arbitrary positions in a container file when it was written.
R: @iemejia (you were the last person other than myself to substantially change this class)
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
R: @username
).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.