File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
spark/src/main/scala/org/apache/comet/rules Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -608,18 +608,20 @@ case class CometExecRule(session: SparkSession) extends Rule[SparkPlan] {
608608 }
609609 }
610610
611- plan.transformUp { case op =>
612- val newOp = convertNode(op)
613- // if newOp is not columnar and newOp.children has columnar, we need to add columnar to row
614- if (! newOp.supportsColumnar && ! newOp.isInstanceOf [ColumnarToRowTransition ]) {
615- val newChildren = newOp.children.map {
611+ val newPlan = plan.transformUp { case op =>
612+ convertNode(op)
613+ }
614+
615+ // insert CometColumnarToRowExec if necessary
616+ newPlan.transformUp {
617+ case c2r : ColumnarToRowTransition => c2r
618+ case op if ! op.supportsColumnar =>
619+ val newChildren = op.children.map {
616620 case c if c.supportsColumnar => CometColumnarToRowExec (c)
617621 case other => other
618622 }
619- newOp.withNewChildren(newChildren)
620- } else {
621- newOp
622- }
623+ op.withNewChildren(newChildren)
624+ case o => o
623625 }
624626 }
625627
You can’t perform that action at this time.
0 commit comments