GitHub user JoshRosen opened a pull request:
https://github.com/apache/spark/pull/5050
[SPARK-3266] Use intermediate abstract classes to fix type erasure issues
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.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/JoshRosen/spark javardd-si-8905-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/5050.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #5050
----
commit d5f3e5da2e8ed54e8e11e913dcc503e7ff468cbf
Author: Josh Rosen <[email protected]>
Date: 2015-03-16T17:26:44Z
Add failing regression tests for SPARK-3266
commit 2feb0680ff59ba516ce6ee9e9c6578d9bad69ffe
Author: Josh Rosen <[email protected]>
Date: 2015-03-16T17:50:42Z
Use intermediate abstract classes to work around SPARK-3266
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]