-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-25408] Move to more ideomatic Java8 #22637
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
|
ok to test |
1 similar comment
|
ok to test |
|
mind filling PR description please? |
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.
Nit: move this onto the previous line
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
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 wouldn't bother with this. This is a copy of some Hive code anyway
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 should still be reverted
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!
|
Jenkins test this please |
|
Test build #96969 has finished for PR 22637 at commit
|
|
Test build #96970 has finished for PR 22637 at commit
|
|
Valid points. Personally I'm a fan of explicit final, instead of implicit. But that's a matter of taste :-) |
|
Test build #96972 has finished for PR 22637 at commit
|
|
Test build #96974 has finished for PR 22637 at commit
|
|
Test build #96967 has finished for PR 22637 at commit
|
|
Test build #96975 has finished for PR 22637 at commit
|
|
retest this please |
|
Test build #96979 has finished for PR 22637 at commit
|
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.
Indentation?
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.
Indentation? It seems to follow 4-space indentation for Java style, but it seems to be too outstanding in this file. For the rest of the patch, could you adjust a little bit more to be consistent in a single file?
|
While we're at it, it would be great to fix the typo in the PR title. |
|
Thanks @dongjoon-hyun. I've fixed the indentation issues. |
|
Test build #97031 has finished for PR 22637 at commit
|
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.
There's a compile error here. But note you can have multiple Closeables declared in one try block anyway, so these can be merged.
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.
My mistake. thanks!
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.
It's hard to know the best way to wrap these things, but here you have the continuation line indented less than the one that starts the statement. I think we can't do that. I'd indent both continuations 2 spaces from their preceding line ideally. Here and elsewhere where the try statement has to wrap.
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 should still be reverted
|
Test build #97063 has finished for PR 22637 at commit
|
Use features from Java8 such as: - Try-with-resource blocks
|
Test build #97072 has finished for PR 22637 at commit
|
|
OK, trying this again. Tests have definitely run this time and we've had another good pass at small review changes. |
While working on another PR, I noticed that there is quite some legacy Java in there that can be beautified. For example the use of features from Java8, such as: - Collection libraries - Try-with-resource blocks No logic has been changed. I think it is important to have a solid codebase with examples that will inspire next PR's to follow up on the best practices. What are your thoughts on this? This makes code easier to read, and using try-with-resource makes is less likely to forget to close something. ## What changes were proposed in this pull request? No changes in the logic of Spark, but more in the aesthetics of the code. ## How was this patch tested? Using the existing unit tests. Since no logic is changed, the existing unit tests should pass. Please review http://spark.apache.org/contributing.html before opening a pull request. Closes apache#22637 from Fokko/SPARK-25408. Authored-by: Fokko Driesprong <[email protected]> Signed-off-by: Sean Owen <[email protected]>
While working on another PR, I noticed that there is quite some legacy Java in there that can be beautified. For example the use of features from Java8, such as:
No logic has been changed. I think it is important to have a solid codebase with examples that will inspire next PR's to follow up on the best practices.
What are your thoughts on this?
This makes code easier to read, and using try-with-resource makes is less likely to forget to close something.
What changes were proposed in this pull request?
No changes in the logic of Spark, but more in the aesthetics of the code.
How was this patch tested?
Using the existing unit tests. Since no logic is changed, the existing unit tests should pass.
Please review http://spark.apache.org/contributing.html before opening a pull request.