diff options
author | Li Yao <hnkfliyao@gmail.com> | 2015-05-28 13:39:39 -0700 |
---|---|---|
committer | Andrew Or <andrew@databricks.com> | 2015-05-28 13:39:39 -0700 |
commit | c771589c96403b2a518fb77d5162eca8f495f37b (patch) | |
tree | 21f5a314984782a0654331ca01c439457276670c /examples/src/main | |
parent | 530efe3e80c62b25c869b85167e00330eb1ddea6 (diff) | |
download | spark-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/src/main')
-rw-r--r-- | examples/src/main/scala/org/apache/spark/examples/SparkPageRank.scala | 2 |
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 => |