aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorLi Yao <hnkfliyao@gmail.com>2015-05-28 13:39:39 -0700
committerAndrew Or <andrew@databricks.com>2015-05-28 13:39:39 -0700
commitc771589c96403b2a518fb77d5162eca8f495f37b (patch)
tree21f5a314984782a0654331ca01c439457276670c /examples
parent530efe3e80c62b25c869b85167e00330eb1ddea6 (diff)
downloadspark-c771589c96403b2a518fb77d5162eca8f495f37b.tar.gz
spark-c771589c96403b2a518fb77d5162eca8f495f37b.tar.bz2
spark-c771589c96403b2a518fb77d5162eca8f495f37b.zip
[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.
Diffstat (limited to 'examples')
-rw-r--r--examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala b/examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala
index 8d092b6506..bd7894f184 100644
--- a/examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala
+++ b/examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala
@@ -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 =>