-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-3266] Use intermediate abstract classes to fix type erasure issues in Java APIs #5050
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
|
Test build #28663 has started for PR 5050 at commit
|
|
Nice one! LGTM |
|
Test build #28663 has finished for PR 5050 at commit
|
|
Test PASSed. |
|
Big thanks to @retronym for suggesting this workaround. |
|
LGTM - should this go into 1.3.1? |
|
Yep, let's pull it into 1.3.1. I suppose that we could backport it to other branches, too, but I think it's most important to get this into our next release so that new users can benefit from it. I'm going to merge this into |
…sues in Java APIs This PR addresses a Scala compiler bug ([SI-8905](https://issues.scala-lang.org/browse/SI-8905)) that was breaking some of the Spark Java APIs. In a nutshell, it seems that methods whose implementations are inherited from generic traits sometimes have their type parameters erased to Object. This was causing methods like `DoubleRDD.min()` to throw confusing NoSuchMethodErrors at runtime. The fix implemented here is to introduce an intermediate layer of abstract classes and inherit from those instead of directly extends the `Java*Like` traits. This should not break binary compatibility. I also improved the test coverage of the Java API, adding several new tests for methods that failed at runtime due to this bug. Author: Josh Rosen <[email protected]> Closes #5050 from JoshRosen/javardd-si-8905-fix and squashes the following commits: 2feb068 [Josh Rosen] Use intermediate abstract classes to work around SPARK-3266 d5f3e5d [Josh Rosen] Add failing regression tests for SPARK-3266 (cherry picked from commit 0f673c2) Signed-off-by: Josh Rosen <[email protected]>
…sues in Java APIs This PR addresses a Scala compiler bug ([SI-8905](https://issues.scala-lang.org/browse/SI-8905)) that was breaking some of the Spark Java APIs. In a nutshell, it seems that methods whose implementations are inherited from generic traits sometimes have their type parameters erased to Object. This was causing methods like `DoubleRDD.min()` to throw confusing NoSuchMethodErrors at runtime. The fix implemented here is to introduce an intermediate layer of abstract classes and inherit from those instead of directly extends the `Java*Like` traits. This should not break binary compatibility. I also improved the test coverage of the Java API, adding several new tests for methods that failed at runtime due to this bug. Author: Josh Rosen <[email protected]> Closes #5050 from JoshRosen/javardd-si-8905-fix and squashes the following commits: 2feb068 [Josh Rosen] Use intermediate abstract classes to work around SPARK-3266 d5f3e5d [Josh Rosen] Add failing regression tests for SPARK-3266 (cherry picked from commit 0f673c2) Signed-off-by: Josh Rosen <[email protected]> Conflicts: core/src/main/scala/org/apache/spark/api/java/JavaRDDLike.scala core/src/test/java/org/apache/spark/JavaAPISuite.java
|
I've also merged this into |
This PR addresses a Scala compiler bug (SI-8905) that was breaking some of the Spark Java APIs. In a nutshell, it seems that methods whose implementations are inherited from generic traits sometimes have their type parameters erased to Object. This was causing methods like
DoubleRDD.min()to throw confusing NoSuchMethodErrors at runtime.The fix implemented here is to introduce an intermediate layer of abstract classes and inherit from those instead of directly extends the
Java*Liketraits. This should not break binary compatibility.I also improved the test coverage of the Java API, adding several new tests for methods that failed at runtime due to this bug.