Skip to content
Snippets Groups Projects
Commit c771589c authored by Li Yao's avatar Li Yao Committed by Andrew Or
Browse files

[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 <hnkfliyao@gmail.com>

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.
parent 530efe3e
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ object SparkPageRank {
showWarning()
val sparkConf = new SparkConf().setAppName("PageRank")
val iters = if (args.length > 0) args(1).toInt else 10
val iters = if (args.length > 1) args(1).toInt else 10
val ctx = new SparkContext(sparkConf)
val lines = ctx.textFile(args(0), 1)
val links = lines.map{ s =>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment