Github user zsxwing commented on the pull request:
https://github.com/apache/spark/pull/6081#issuecomment-102113399
@adrian-wang your codes cannot pass the following test. Could you add it
in the unit tests and fix the bug?
```Scala
import org.scalatest.FunSuite
class RangeSuite extends FunSuite with LocalSparkContext{
test("aaaa") {
sc = new SparkContext(new
SparkConf().setAppName("test").setMaster("local"))
for (numSlices <- 1 to 10) {
for (start <- -10 to 10) {
for (end <- -10 to 10) {
for (step <- (-20 to 20).filter(_ != 0)) {
val scalaRange = Range(start, end, step).toList.sorted
val sparkRange = sc.range(start, end, step,
numSlices).collect().sorted.toList
assert(scalaRange === sparkRange,
s"start=$start end=$end step$step excepted: $scalaRange but
was $sparkRange")
}
}
}
}
}
}
```
Error:
```
List() did not equal List(-10) start=-10 end=-9 step-20 excepted: List()
but was List(-10) (RangeTest.scala:15)
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]