Skip to content

Commit f91e55e

Browse files
authored
make rdd count be n
1 parent e877415 commit f91e55e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/src/main/scala/org/apache/spark/examples/SparkPi.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ object SparkPi {
3131
.getOrCreate()
3232
val slices = if (args.length > 0) args(0).toInt else 2
3333
val n = math.min(100000L * slices, Int.MaxValue).toInt // avoid overflow
34-
val count = spark.sparkContext.parallelize(1 until n, slices).map { i =>
34+
val count = spark.sparkContext.parallelize(1 to n, slices).map { i =>
3535
val x = random * 2 - 1
3636
val y = random * 2 - 1
3737
if (x*x + y*y < 1) 1 else 0

0 commit comments

Comments
 (0)