Skip to content
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

[SPARK-25029][BUILD][CORE] Janino "Two non-abstract methods ..." errors #22203

Closed
wants to merge 2 commits into from

Conversation

srowen
Copy link
Member

@srowen srowen commented Aug 23, 2018

What changes were proposed in this pull request?

Update to janino 3.0.9 to address Java 8 + Scala 2.12 incompatibility. The error manifests as test failures like this in ExpressionEncoderSuite:

- encode/decode for seq of string: List(abc, xyz) *** FAILED ***
java.lang.RuntimeException: Error while encoding: org.codehaus.janino.InternalCompilerException: failed to compile: org.codehaus.janino.InternalCompilerException: Compiling "GeneratedClass": Two non-abstract methods "public int scala.collection.TraversableOnce.size()" have the same parameter types, declaring type and return type

It comes up pretty immediately in any generated code that references Scala collections, and virtually always concerning the size() method.

How was this patch tested?

Existing tests

@SparkQA
Copy link

SparkQA commented Aug 23, 2018

Test build #95158 has finished for PR 22203 at commit b7c7bdb.

  • This patch fails build dependency tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Aug 23, 2018

Test build #95159 has finished for PR 22203 at commit 848bf1c.

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

@@ -98,7 +98,7 @@ jackson-module-jaxb-annotations-2.6.7.jar
jackson-module-paranamer-2.7.9.jar
jackson-module-scala_2.11-2.6.7.1.jar
jackson-xc-1.9.13.jar
janino-3.0.8.jar
janino-3.0.9.jar
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It includes the fix of your issue janino-compiler/janino#46

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep my primary reason is pulling in this fix for Scala 2.12: janino-compiler/janino#54 The other changes I can see appear to be small bug fixes, some for Java 8 / 9 support, which is probably useful for us.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being late. I confirmed all of changes in the changelog. Two issues janino-compiler/janino#54 and janino-compiler/janino#46 are for Java 8 and later support. Others are bug fixes.

LGTM.

@rednaxelafx
Copy link
Contributor

LGTM

@rednaxelafx
Copy link
Contributor

I'm wondering, though, either in the same PR or in a separate PR, could we add a test case in Spark that would trigger the "two non-abstract method" error so that we'd show an example scenario in Spark that'd trigger the issue and also show that Janino 3.0.9 has fixed it?

@srowen
Copy link
Member Author

srowen commented Aug 23, 2018

Good point @rednaxelafx though I know some existing tests already definitely failed without this change. They're in the JIRA. It's pervasive enough that we'd see a number of failures due to this issue -- or at least I did when running this in Scala 2.12.

@rednaxelafx
Copy link
Contributor

Thanks @srowen ! In that case could we add a few mentions of such test cases that failed into the PR description itself, perhaps a few lines under the "How was this patch tested?" section to give a few examples of which tests used to fail and are now fixed?

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

@srowen
Copy link
Member Author

srowen commented Aug 24, 2018

Done, I added one example test failure to the description here.

@gatorsmile
Copy link
Member

Thanks! Merged to master

@asfgit asfgit closed this in 9b6baeb Aug 24, 2018
@srowen srowen deleted the SPARK-25029 branch August 26, 2018 13:37
curtishoward pushed a commit to twosigma/spark that referenced this pull request Oct 31, 2018
Update to janino 3.0.9 to address Java 8 + Scala 2.12 incompatibility. The error manifests as test failures like this in `ExpressionEncoderSuite`:

```
- encode/decode for seq of string: List(abc, xyz) *** FAILED ***
java.lang.RuntimeException: Error while encoding: org.codehaus.janino.InternalCompilerException: failed to compile: org.codehaus.janino.InternalCompilerException: Compiling "GeneratedClass": Two non-abstract methods "public int scala.collection.TraversableOnce.size()" have the same parameter types, declaring type and return type
```

It comes up pretty immediately in any generated code that references Scala collections, and virtually always concerning the `size()` method.

Existing tests

Closes apache#22203 from srowen/SPARK-25029.

Authored-by: Sean Owen <sean.owen@databricks.com>
Signed-off-by: Xiao Li <gatorsmile@gmail.com>
(cherry picked from commit 9b6baeb)
curtishoward pushed a commit to twosigma/spark that referenced this pull request Oct 31, 2018
Update to janino 3.0.9 to address Java 8 + Scala 2.12 incompatibility. The error manifests as test failures like this in `ExpressionEncoderSuite`:

```
- encode/decode for seq of string: List(abc, xyz) *** FAILED ***
java.lang.RuntimeException: Error while encoding: org.codehaus.janino.InternalCompilerException: failed to compile: org.codehaus.janino.InternalCompilerException: Compiling "GeneratedClass": Two non-abstract methods "public int scala.collection.TraversableOnce.size()" have the same parameter types, declaring type and return type
```

It comes up pretty immediately in any generated code that references Scala collections, and virtually always concerning the `size()` method.

Existing tests

Closes apache#22203 from srowen/SPARK-25029.

Authored-by: Sean Owen <sean.owen@databricks.com>
Signed-off-by: Xiao Li <gatorsmile@gmail.com>
(cherry picked from commit 9b6baeb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants