cloud-fan commented on a change in pull request #25264:
[SPARK-28213][SQL][followup] code cleanup and bug fix for columnar execution
framework
URL: https://github.com/apache/spark/pull/25264#discussion_r308037696
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/WholeStageCodegenExec.scala
##########
@@ -870,55 +859,41 @@ case class CollapseCodegenStages(
/**
* Inserts an InputAdapter on top of those that do not support codegen.
*/
- private def insertInputAdapter(plan: SparkPlan, isColumnarInput: Boolean):
SparkPlan = {
- val isColumnar = adjustColumnar(plan, isColumnarInput)
+ private def insertInputAdapter(plan: SparkPlan): SparkPlan = {
plan match {
case p if !supportCodegen(p) =>
// collapse them recursively
- InputAdapter(insertWholeStageCodegen(p, isColumnar), isColumnar)
+ InputAdapter(insertWholeStageCodegen(p))
case j: SortMergeJoinExec =>
// The children of SortMergeJoin should do codegen separately.
j.withNewChildren(j.children.map(
- child => InputAdapter(insertWholeStageCodegen(child, isColumnar),
isColumnar)))
- case p =>
- p.withNewChildren(p.children.map(insertInputAdapter(_, isColumnar)))
+ child => InputAdapter(insertWholeStageCodegen(child))))
+ // `ColumnarToRowExec` is kind of a leaf node to whole-stage-codegen.
Its generated code can
+ // process data from the input RDD directly.
+ case c: ColumnarToRowExec => c
Review comment:
no, because `ColumnarToRowExec` is leaf node of the codegen stage. But you
remind me that we should call `insertWholeStageCodegen`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]