-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PARQUET-1922: Deprecate IOExceptionUtils #825
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,7 +127,6 @@ public void reset() { | |
| @Override | ||
| public void close() { | ||
| arrayOut.close(); | ||
| out.close(); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,9 +18,6 @@ | |
| */ | ||
| package org.apache.parquet.bytes; | ||
|
|
||
| import org.apache.parquet.IOExceptionUtils; | ||
| import org.apache.parquet.ParquetRuntimeException; | ||
|
|
||
| import java.io.IOException; | ||
| import java.io.OutputStream; | ||
|
|
||
|
|
@@ -210,8 +207,8 @@ public final void writeDouble(double v) throws IOException { | |
| writeLong(Double.doubleToLongBits(v)); | ||
| } | ||
|
|
||
| public void close() { | ||
| IOExceptionUtils.closeQuietly(out); | ||
| public void close() throws IOException { | ||
|
||
| out.close(); | ||
| } | ||
|
|
||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
outin this case is wrapsarrayOut, and it has no buffering, so it does not need to be explicitly closed, or better, in the future,outshould be closed only andarrayOutwill be closed implicitly. Anyway, I came to this conclusion because this is howclose()is implemented in a couple of other Writer classes as well.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.
I would either close only
arrayOutbut with comments about what you have written here or close onlyoutand catching theIOExceptionthat would never occur and comment in the catch block similarly.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.
@gszadovszky Thanks for the review!
I think this line of work should be pursued in a different ticket. This change makes this PR's changes possible, but also puts it in line with other implementations:
https://github.com/apache/parquet-mr/blob/dc61e510126aaa1a95a46fe39bf1529f394147e9/parquet-column/src/main/java/org/apache/parquet/column/values/plain/FixedLenByteArrayPlainValuesWriter.java#L88-L90
So if we want to change how things are closed (nice, but technically not required) it can be addressed holistically.
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.
I am fine fixing this in another ticket. What I think is a key in this change is to put the related comments (
out.closeis not required because...) in the code as well as in this review.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.
@gszadovszky OK, finally got back to this. Ha. I added a comment. Please consider for merge.