Skip to content

Commit

Permalink
Updated doc for Limit.
Browse files Browse the repository at this point in the history
  • Loading branch information
rxin committed Mar 26, 2014
1 parent 47d3327 commit 9b79246
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ case class Union(children: Seq[SparkPlan])(@transient sc: SparkContext) extends
}

/**
* Take the first limit elements.
* Take the first limit elements. Note that the implementation is different depending on whether
* this is a terminal operator or not. If it is terminal and is invoked using executeCollect,
* this operator uses Spark's take method on the Spark driver. If it is not terminal or is
* invoked using execute, we first take the limit on each partition, and then repartition all the
* data to a single partition to compute the global limit.
*/
case class Limit(limit: Int, child: SparkPlan)(@transient sc: SparkContext) extends UnaryNode {
override def otherCopyArgs = sc :: Nil
// Note that the implementation is different depending on
// whether this is a terminal operator or not.

override def output = child.output

Expand Down

0 comments on commit 9b79246

Please sign in to comment.