Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address comments
  • Loading branch information
Davies Liu committed Mar 1, 2016
commit cff0871048d3a2d4e420164ef3d6fd9c74f7aa90
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,23 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product {

/**
* All the nodes that will be used to generate tree string.
*
* For example:
*
* node
* : +- innerChildren
* +- treeChildren
*/
protected def treeChildren: Seq[BaseType] = children

/**
* All the nodes those are parts of this node.
* All the nodes that are parts of this node.
*
* innerChildren will be printed with one more level of indent, for example:
*
* node
* : +- innerChildren
* +- treeChildren
*/
protected def innerChildren: Seq[BaseType] = Nil

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,21 +348,17 @@ case class WholeStageCodegen(child: SparkPlan) extends UnaryNode with CodegenSup
}
}

private[sql] override def resetMetrics(): Unit = {
child.foreach(_.resetMetrics())
}

override def innerChildren: Seq[SparkPlan] = {
child :: Nil
}

private def collectDirectInputs(plan: SparkPlan): Seq[SparkPlan] = plan match {
private def collectInputs(plan: SparkPlan): Seq[SparkPlan] = plan match {
case InputAdapter(c) => c :: Nil
case other => other.children.flatMap(collectDirectInputs)
case other => other.children.flatMap(collectInputs)
}

override def treeChildren: Seq[SparkPlan] = {
collectDirectInputs(child)
collectInputs(child)
}

override def simpleString: String = "WholeStageCodegen"
Expand Down