-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-25362][JavaAPI] Replace Spark Optional class with Java Optional #22383
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
|
We can't do this until we decide whether the next version will be a major version or not. This breaks backwards compatibility. (See the bug I duplicated your bug to.) |
|
Yeah this is the right kind of change but needs to wait for now. Can you update the title? |
|
Done @srowen |
srowen
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.
@mmolimar we can move forward with this now. Can you put SPARK-25395 in the title instead? that was the original JIRA.
| new Tuple2<>(4, 'w') | ||
| )); | ||
| List<Tuple2<Integer,Tuple2<Integer,Optional<Character>>>> joined = | ||
| List<Tuple2<Integer,Tuple2<Integer, Optional<Character>>>> joined = |
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.
@mmolimar Could you revert these whitespace changes?
|
Updated @srowen |
|
Oops, I mean SPARK-25362. SPARK-25395 was a duplicate. |
|
No problem. Done ;-) |
|
Test build #4368 has finished for PR 22383 at commit
|
|
Yeah, you'll have to add this to the 3.0 excludes section of project/MimaExcludes:
|
|
Test build #4376 has finished for PR 22383 at commit
|
|
Test build #4379 has finished for PR 22383 at commit
|
|
Oh, hm: So Unless someone has a bright idea I think we can't do this. Same reason I was unable to change Spark to use |
|
I agree @srowen. |
|
Spark's class only reason to exist is so we do not use the Guava class, since everyone and their pet want to use a different version of Guava (and Spark shades it for that reason). |
|
Yeah, I think we just can't do this unfortunately. It was worth looking into. |
Closes apache#22567 Closes apache#18457 Closes apache#21517 Closes apache#21858 Closes apache#22383 Closes apache#19219 Closes apache#22401 Closes apache#22811 Closes apache#20405 Closes apache#21933 Closes apache#22819 from srowen/ClosePRs. Authored-by: Sean Owen <sean.owen@databricks.com> Signed-off-by: Sean Owen <sean.owen@databricks.com>
What changes were proposed in this pull request?
Previous Spark versions didn't require Java 8 and an
OptionalSpark Java API had to be implemented to support optional values.Since Spark 2.4 uses Java 8, the
OptionalSpark Java API should be removed so that Spark uses the original Java API.How was this patch tested?
OptionalSuiteclass was removed to test Spark Java APIOptionalclass (this class as well).Notice that the
getmethod in the Spark Java APIOptionalclass throws aNullPointerExceptionwhen the value is not set whereas the native Java APIjava.util.Optionalthrows aNoSuchElementException.