Skip to content

Conversation

@JoshRosen
Copy link
Contributor

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*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.

@SparkQA
Copy link

SparkQA commented Mar 16, 2015

Test build #28663 has started for PR 5050 at commit 2feb068.

  • This patch merges cleanly.

@srowen
Copy link
Member

srowen commented Mar 16, 2015

Nice one! LGTM

@SparkQA
Copy link

SparkQA commented Mar 16, 2015

Test build #28663 has finished for PR 5050 at commit 2feb068.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins
Copy link

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/28663/
Test PASSed.

@JoshRosen
Copy link
Contributor Author

Big thanks to @retronym for suggesting this workaround.

@rxin
Copy link
Contributor

rxin commented Mar 17, 2015

LGTM - should this go into 1.3.1?

@JoshRosen
Copy link
Contributor Author

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 master (1.4.0) and branch-1.3 (1.3.1).

@asfgit asfgit closed this in 0f673c2 Mar 17, 2015
asfgit pushed a commit that referenced this pull request Mar 17, 2015
…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]>
asfgit pushed a commit that referenced this pull request Mar 24, 2015
…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
@JoshRosen
Copy link
Contributor Author

I've also merged this into branch-1.2 (1.2.2).

@JoshRosen JoshRosen deleted the javardd-si-8905-fix branch March 24, 2015 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants