Github user marmbrus commented on a diff in the pull request:
https://github.com/apache/spark/pull/233#discussion_r10965792
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/basicOperators.scala ---
@@ -48,37 +48,50 @@ case class Filter(condition: Expression, child:
SparkPlan) extends UnaryNode {
case class Sample(fraction: Double, withReplacement: Boolean, seed: Int,
child: SparkPlan)
extends UnaryNode {
- def output = child.output
+ override def output = child.output
// TODO: How to pick seed?
- def execute() = child.execute().sample(withReplacement, fraction, seed)
+ override def execute() = child.execute().sample(withReplacement,
fraction, seed)
}
case class Union(children: Seq[SparkPlan])(@transient sc: SparkContext)
extends SparkPlan {
// TODO: attributes output by union should be distinct for nullability
purposes
- def output = children.head.output
- def execute() = sc.union(children.map(_.execute()))
+ override def output = children.head.output
+ override def execute() = sc.union(children.map(_.execute()))
override def otherCopyArgs = sc :: Nil
}
-case class StopAfter(limit: Int, child: SparkPlan)(@transient sc:
SparkContext) extends UnaryNode {
+/**
+ * Take the first limit elements.
+ */
+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.
--- End diff --
maybe move this to the scala doc?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---