-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
AVRO-3748 [java] fix SeekableInputStream.skip #2203
Conversation
lang/java/avro/src/main/java/org/apache/avro/file/DataFileReader.java
Outdated
Show resolved
Hide resolved
eb9db9d
to
de24e81
Compare
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
w.write("someContent"); | ||
} | ||
try(DataFileReader.SeekableInputStream stream = | ||
new DataFileReader.SeekableInputStream(new SeekableFileInput(f)) |
Check warning
Code scanning / CodeQL
Potential input resource leak
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.
Done
try(DataFileReader.SeekableInputStream stream = | ||
new DataFileReader.SeekableInputStream(new SeekableFileInput(f)) | ||
) { | ||
for (int i = 0; i < stream.length(); i++) { |
Check failure
Code scanning / CodeQL
Comparison of narrow type with wide type in loop condition
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.
Done
The implementation of SeekableInputStream.skip had a longstantind issue that it did a seek to a wrong position. This issue is rather difficult to hit in avro as it is only used in corner cases of for example the FastReader.
The implementation of SeekableInputStream.skip had a longstantind issue that it did a seek to a wrong position. This issue is rather difficult to hit in avro as it is only used in corner cases of for example the FastReader.
…pache#2446) This reverts commit 33631e1.
The implementation of SeekableInputStream.skip had a longstantind issue that it did a seek to a wrong position.
This issue is rather difficult to hit in avro as it is only used in corner cases of for example the FastReader.
What is the purpose of the change
Verifying this change
This change added a test to verify the new behavior
Documentation