-
Notifications
You must be signed in to change notification settings - Fork 28.9k
[SPARK-29292][SPARK-30010][CORE] Let core compile for Scala 2.13 #28971
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
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Jenkins retest this please |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@shaneknapp I think we have the same corrupted .m2 repository issue again. Do I just keep retesting until it doesn't hit the worker? |
|
Jenkins retest this please |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Jenkins retest this please |
This comment has been minimized.
This comment has been minimized.
|
Thank you so much, @srowen ! |
This comment has been minimized.
This comment has been minimized.
|
|
||
| def stateValid(): Boolean = { | ||
| (workers.map(_.ip) -- liveWorkerIPs).isEmpty && | ||
| workers.map(_.ip).forall(liveWorkerIPs.contains) && |
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.
Nit: What about using diff here?
As I see diff is not deprecated: https://www.scala-lang.org/api/current/scala/collection/Seq.html#diff[B%3E:A](that:scala.collection.Seq[B]):C
| workers.map(_.ip).forall(liveWorkerIPs.contains) && | |
| workers.map(_.ip).diff(liveWorkerIPs).isEmpty && |
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.
diff would work too, I think. It has multiset semantics, and I thought it was not necessary here. I went for what I thought was simpler, but I am not 100% sure.
| } | ||
| else { | ||
| new Range(r.start + start * r.step, r.start + end * r.step, r.step) | ||
| new Range.Inclusive(r.start + start * r.step, r.start + end * r.step - 1, r.step) |
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.
What about Range.Exclusive?
| new Range.Inclusive(r.start + start * r.step, r.start + end * r.step - 1, r.step) | |
| new Range.Exclusive(r.start + start * r.step, r.start + end * r.step, r.step) |
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.
Range.Exclusive doesn't exist in 2.12, and Range() (exclusive in 2.12) doesn't exist in 2.13. :( I tried that initially. Because these are integers, I think we can get away with an Inclusive range that ends at end - 1 instead.
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.
I see. In this case this is totally fine.
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.
One more question: what about using until and by?
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.
It's probably equivalent, yeah. I was shooting for minimal change here, but there may be several solutions.
|
Jenkins test this please |
This comment has been minimized.
This comment has been minimized.
|
Test build #124915 has finished for PR 28971 at commit
|
|
Jenkins retest this please |
|
Test build #124916 has finished for PR 28971 at commit
|
|
Retest this please. |
|
Test build #125479 has started for PR 28971 at commit |
|
Jenkins retest this please |
|
Test build #125499 has started for PR 28971 at commit |
|
Retest this please |
|
Test build #125648 has finished for PR 28971 at commit
|
|
Jenkins retest this please |
|
Test build #125682 has finished for PR 28971 at commit
|
| else { | ||
| new Range(r.start + start * r.step, r.start + end * r.step, r.step) | ||
| } else { | ||
| new Range.Inclusive(r.start + start * r.step, r.start + (end - 1) * r.step, r.step) |
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.
For previous reviewers: I fixed a bug from my initial change here. The non-inclusive end is not 1 less than the exclusive end, but one less r.step
| resourceProfileManager: ResourceProfileManager) | ||
| extends CoarseGrainedSchedulerBackend(scheduler, rpcEnv) { | ||
|
|
||
| def this() = this(null, null, null, null) |
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.
I still have no idea how this wasn't required in Scala 2.12, as it's used with a no-arg constructor but none existed ?!
|
|
||
| test("top with predefined ordering") { | ||
| val nums = Array.range(1, 100000) | ||
| val nums = Seq.range(1, 100000) |
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.
Side comment: generally speaking Seq types have less weird generic type problems than Arrays. This is a good example
|
Great, @srowen ! |
|
Could you fix the following four instances together in this PR, @srowen ? |
|
Oh where do you see that? I can't find it in the test logs. That should be fine on 2.12 but is also working on my local 2.13 compilation. |
|
I built with 2.13.3 like the following to verify this PR. |
|
Oh, you have to build with |
|
Oh. Got it. Thanks! |
|
Oh, I did miss one necessary change. The room pom has to update to scala 2.13.3, yes. Let me get that part of the change in here. |
dongjoon-hyun
left a comment
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.
+1, LGTM. Everything works. Thank you so much, @srowen .
Merged to master for Apache Spark 3.1.0.
|
Oh OK I wanted to make sure everyone was OK with the approach, but I think so as it's been the plan for a long time AFAICT. I will start making other similar PRs (this one does not resolved SPARK-29292 by itself) |
|
Sorry for the rush. If needed, we are able to switch our approaches during Apache Spark 3.1.0 timeline. I believe this healthy |
|
Test build #125693 has finished for PR 28971 at commit
|
…piling for Scala 2.13 ### What changes were proposed in this pull request? Continuation of #28971 which lets streaming, catalyst and sql compile for 2.13. Same idea. ### Why are the changes needed? Eventually, we need to support a Scala 2.13 build, perhaps in Spark 3.1. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Existing tests. (2.13 was not tested; this is about getting it to compile without breaking 2.12) Closes #29078 from srowen/SPARK-29292.2. Authored-by: Sean Owen <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
| * Set multiple parameters together | ||
| */ | ||
| @deprecated("Use setAll(Iterable) instead", "3.0.0") | ||
| def setAll(settings: Traversable[(String, String)]): SparkConf = { |
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.
@srowen, BTW, it might be best to file a JIRA as a reminder to keep this API back if we can't make Scala 2.13 in Spark 3.1.
I believe it is legitimate and inevitable to remove this because of Scala 2.13 but it might be problematic if we can't make it in Spark 3.1, and have a release out only with Scala 2.12.
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.
Yeah if the whole thing doesn't make it for 3.1, I'd leave this method in 3.1.
… for Scala 2.13 compilation ### What changes were proposed in this pull request? Same as #29078 and #28971 . This makes the rest of the default modules (i.e. those you get without specifying `-Pyarn` etc) compile under Scala 2.13. It does not close the JIRA, as a result. this also of course does not demonstrate that tests pass yet in 2.13. Note, this does not fix the `repl` module; that's separate. ### Why are the changes needed? Eventually, we need to support a Scala 2.13 build, perhaps in Spark 3.1. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing tests. (2.13 was not tested; this is about getting it to compile without breaking 2.12) Closes #29111 from srowen/SPARK-29292.3. Authored-by: Sean Owen <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
…ing modules ### What changes were proposed in this pull request? See again the related PRs like #28971 This completes fixing compilation for 2.13 for all but `repl`, which is a separate task. ### Why are the changes needed? Eventually, we need to support a Scala 2.13 build, perhaps in Spark 3.1. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing tests. (2.13 was not tested; this is about getting it to compile without breaking 2.12) Closes #29147 from srowen/SPARK-29292.4. Authored-by: Sean Owen <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
What changes were proposed in this pull request?
The purpose of this PR is to partly resolve SPARK-29292, and fully resolve SPARK-30010, which should allow Spark to compile vs Scala 2.13 in Spark Core and up through GraphX (not SQL, Streaming, etc).
Note that we are not trying to determine here whether this makes Spark work on 2.13 yet, just compile, as a prerequisite for assessing test outcomes. However, of course, we need to ensure that the change does not break 2.12.
The changes are, in the main, adding .toSeq and .toMap calls where mutable collections / maps are returned as Seq / Map, which are immutable by default in Scala 2.13. The theory is that it should be a no-op for Scala 2.12 (these return themselves), and required for 2.13.
There are a few non-trivial changes highlighted below.
In particular, to get Core to compile, we need to resolve SPARK-30010 which removes a deprecated SparkConf method
Why are the changes needed?
Eventually, we need to support a Scala 2.13 build, perhaps in Spark 3.1.
Does this PR introduce any user-facing change?
Yes, removal of the deprecated SparkConf.setAll overload, which isn't legal in Scala 2.13 anymore.
How was this patch tested?
Existing tests. (2.13 was not tested; this is about getting it to compile without breaking 2.12)