File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
sql/core/src/main/scala/org/apache/spark/sql/execution Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,14 @@ case class Union(children: Seq[SparkPlan])(@transient sc: SparkContext) extends
63
63
}
64
64
65
65
/**
66
- * Take the first limit elements.
66
+ * Take the first limit elements. Note that the implementation is different depending on whether
67
+ * this is a terminal operator or not. If it is terminal and is invoked using executeCollect,
68
+ * this operator uses Spark's take method on the Spark driver. If it is not terminal or is
69
+ * invoked using execute, we first take the limit on each partition, and then repartition all the
70
+ * data to a single partition to compute the global limit.
67
71
*/
68
72
case class Limit (limit : Int , child : SparkPlan )(@ transient sc : SparkContext ) extends UnaryNode {
69
73
override def otherCopyArgs = sc :: Nil
70
- // Note that the implementation is different depending on
71
- // whether this is a terminal operator or not.
72
74
73
75
override def output = child.output
74
76
You can’t perform that action at this time.
0 commit comments