Skip to content

Commit c771589

Browse files
lastlandAndrew Or
authored andcommitted
[MINOR] Fix the a minor bug in PageRank Example.
Fix the bug that entering only 1 arg will cause array out of bounds exception in PageRank example. Author: Li Yao <[email protected]> Closes #6455 from lastland/patch-1 and squashes the following commits: de06128 [Li Yao] Fix the bug that entering only 1 arg will cause array out of bounds exception.
1 parent 530efe3 commit c771589

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ object SparkPageRank {
5151
showWarning()
5252

5353
val sparkConf = new SparkConf().setAppName("PageRank")
54-
val iters = if (args.length > 0) args(1).toInt else 10
54+
val iters = if (args.length > 1) args(1).toInt else 10
5555
val ctx = new SparkContext(sparkConf)
5656
val lines = ctx.textFile(args(0), 1)
5757
val links = lines.map{ s =>

0 commit comments

Comments
 (0)