diff options
author | Sandy Ryza <sandy@cloudera.com> | 2014-06-17 12:03:22 -0700 |
---|---|---|
committer | Patrick Wendell <pwendell@gmail.com> | 2014-06-17 12:03:22 -0700 |
commit | 2794990e9eb8712d76d3a0f0483063ddc295e639 (patch) | |
tree | b6d9d6b0f2db0383a3c2ec855b5b3c39a2ea8cce | |
parent | b92d16b114fd49e881d09e7974ad57b2a0df2906 (diff) | |
download | spark-2794990e9eb8712d76d3a0f0483063ddc295e639.tar.gz spark-2794990e9eb8712d76d3a0f0483063ddc295e639.tar.bz2 spark-2794990e9eb8712d76d3a0f0483063ddc295e639.zip |
SPARK-2146. Fix takeOrdered doc
Removes Python syntax in Scaladoc, corrects result in Scaladoc, and removes irrelevant cache() call in Python doc.
Author: Sandy Ryza <sandy@cloudera.com>
Closes #1086 from sryza/sandy-spark-2146 and squashes the following commits:
185ff18 [Sandy Ryza] Use Seq instead of Array
c996120 [Sandy Ryza] SPARK-2146. Fix takeOrdered doc
-rw-r--r-- | core/src/main/scala/org/apache/spark/rdd/RDD.scala | 16 | ||||
-rw-r--r-- | python/pyspark/rdd.py | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/core/src/main/scala/org/apache/spark/rdd/RDD.scala b/core/src/main/scala/org/apache/spark/rdd/RDD.scala index cf915b870e..1633b18586 100644 --- a/core/src/main/scala/org/apache/spark/rdd/RDD.scala +++ b/core/src/main/scala/org/apache/spark/rdd/RDD.scala @@ -1074,11 +1074,11 @@ abstract class RDD[T: ClassTag]( * Returns the top K (largest) elements from this RDD as defined by the specified * implicit Ordering[T]. This does the opposite of [[takeOrdered]]. For example: * {{{ - * sc.parallelize([10, 4, 2, 12, 3]).top(1) - * // returns [12] + * sc.parallelize(Seq(10, 4, 2, 12, 3)).top(1) + * // returns Array(12) * - * sc.parallelize([2, 3, 4, 5, 6]).top(2) - * // returns [6, 5] + * sc.parallelize(Seq(2, 3, 4, 5, 6)).top(2) + * // returns Array(6, 5) * }}} * * @param num the number of top elements to return @@ -1092,11 +1092,11 @@ abstract class RDD[T: ClassTag]( * implicit Ordering[T] and maintains the ordering. This does the opposite of [[top]]. * For example: * {{{ - * sc.parallelize([10, 4, 2, 12, 3]).takeOrdered(1) - * // returns [12] + * sc.parallelize(Seq(10, 4, 2, 12, 3)).takeOrdered(1) + * // returns Array(2) * - * sc.parallelize([2, 3, 4, 5, 6]).takeOrdered(2) - * // returns [2, 3] + * sc.parallelize(Seq(2, 3, 4, 5, 6)).takeOrdered(2) + * // returns Array(2, 3) * }}} * * @param num the number of top elements to return diff --git a/python/pyspark/rdd.py b/python/pyspark/rdd.py index 65f63153cd..a0b2c744f0 100644 --- a/python/pyspark/rdd.py +++ b/python/pyspark/rdd.py @@ -857,7 +857,7 @@ class RDD(object): Note: It returns the list sorted in descending order. >>> sc.parallelize([10, 4, 2, 12, 3]).top(1) [12] - >>> sc.parallelize([2, 3, 4, 5, 6], 2).cache().top(2) + >>> sc.parallelize([2, 3, 4, 5, 6], 2).top(2) [6, 5] """ def topIterator(iterator): |