srowen commented on a change in pull request #28971:
URL: https://github.com/apache/spark/pull/28971#discussion_r453222075
##########
File path: core/src/main/scala/org/apache/spark/rdd/ParallelCollectionRDD.scala
##########
@@ -133,12 +133,11 @@ private object ParallelCollectionRDD {
// If the range is inclusive, use inclusive range for the last slice
if (r.isInclusive && index == numSlices - 1) {
new Range.Inclusive(r.start + start * r.step, r.end, r.step)
- }
- 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)
Review comment:
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`
##########
File path: core/src/test/scala/org/apache/spark/HeartbeatReceiverSuite.scala
##########
@@ -287,6 +287,8 @@ private class FakeSchedulerBackend(
resourceProfileManager: ResourceProfileManager)
extends CoarseGrainedSchedulerBackend(scheduler, rpcEnv) {
+ def this() = this(null, null, null, null)
Review comment:
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 ?!
##########
File path: core/src/test/scala/org/apache/spark/rdd/RDDSuite.scala
##########
@@ -656,7 +656,7 @@ class RDDSuite extends SparkFunSuite with
SharedSparkContext with Eventually {
}
test("top with predefined ordering") {
- val nums = Array.range(1, 100000)
+ val nums = Seq.range(1, 100000)
Review comment:
Side comment: generally speaking Seq types have less weird generic type
problems than Arrays. This is a good example
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]