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
[FLINK-10911][scala-shell] Enable flink-scala-shell with Scala 2.12 #11895
Conversation
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit f112d10 (Fri May 28 09:13:12 UTC 2021) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
@flinkbot run azure |
Can you give a quick note on what the goal of this PR is? |
@zentol It is WIP PR, I can run scala shell 2.12 successfully in my local machine. I just want to run it in CI to check whether it can pass CI. |
@flinkbot run azure |
@tillrohrmann @aljoscha @zentol Could you help review this PR ? Thanks |
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.
Thanks for creating this PR @zjffdu. I think CI is not conclusive at this point since it did not run the Scala 2.12 profiles. Please make sure that these builds have run. Otherwise we cannot move forward with this PR.
Ah sorry @tillrohrmann! While you were writing your message I was merging the PR. I was assuming that azure and travis run the Scala 2.12 profiles. What should we do? |
I'm running the test locally now. |
The tests don't pass, I reverted the change on master. Sorry about this, I was too eager in merging. |
@aljoscha What kind of error do you see ? |
The assertions in |
It is weird, I remember I ran test successfully before, let me try it again. |
We only use scala 2.11 on CI; this is fully independent of whether the scala-shell tests run or not. |
@aljoscha I found the reason why I ran it successfully last time. I only run Regarding this issue, I found that after I use |
@zentol How do you mean? When building with Scala 2.11 |
@aljoscha yes? In any case we only run 2.11 on CI, that's all I was saying. This was a response to the previous comment from Jeff:
|
@aljoscha Right, spark use |
@aljoscha I found that the case class issue is caused by |
@zjffdu Should we still try and get this in for Flink 1.12? Sorry for the very long delay on this one! 😱 |
Sorry @aljoscha I am afraid I don't have time to get it into 1.12, let's try that in the next release. |
No worries. 😃 |
Just to clarify - after building a scala-shell with the changes from this PR, and testing as follows:
bin/start-scala-shell.sh local
scala> case class Pair(x: Int, y: Int)
defined class Pair
scala> benv.fromElements(1,2,3).map(x => Pair(x,x)).collect()
java.lang.IllegalArgumentException: requirement failed:
The class Pair is an instance class, meaning it is not a member of a
toplevel object, or of an object contained in a toplevel object,
therefore it requires an outer instance to be instantiated, but we don't have a
reference to the outer instance. Please consider changing the outer class to an object.
at scala.Predef$.require(Predef.scala:277)
at org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer$.lookupConstructor(ScalaCaseClassSerializer.scala:97)
at org.apache.flink.api.scala.typeutils.ScalaCaseClassSerializer.<init>(ScalaCaseClassSerializer.scala:46)
... 70 elided The problem is that with I am not sure what were the use-cases that lead the Scala team (and Spark) to adopt FYI in Scala 2.13 the default is class-based and it needs to be explicitly disabled with @aljoscha / @zjffdu: do you know any particular scenarios where object-based REPL is problematic? |
@aalexandrov Thanks for looking into this issue, here's 2 tickets that are related |
Closing this PR due to https://issues.apache.org/jira/browse/FLINK-24360 / #17340 |
What is the purpose of the change
This PR is to enable flink-scala-shell with scala-2.12. Previous we disable it because flink scala shell doesn't work with scala 2.12, but now it seems not true. The CI is passed and I also verify it in my local machine. flink scala-shell works well with scala 2.12.
Brief change log
Just enable flink-scala-shell with scala 2.12 in pom file
Verifying this change
This change is already covered by existing tests.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (no)Documentation