andygrove commented on code in PR #4509:
URL: https://github.com/apache/datafusion-comet/pull/4509#discussion_r3406303953
##########
spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala:
##########
@@ -701,21 +701,37 @@ case class CometExecRule(session: SparkSession)
}
val builder = OperatorOuterClass.Operator.newBuilder().setPlanId(op.id)
- if (op.children.nonEmpty &&
op.children.forall(_.isInstanceOf[CometNativeExec])) {
- val childOp = op.children.map(_.asInstanceOf[CometNativeExec].nativeOp)
- childOp.foreach(builder.addChildren)
- return serde
- .convert(op, builder, childOp: _*)
- .map(nativeOp => serde.createExec(nativeOp, op))
- } else {
- return serde
- .convert(op, builder)
- .map(nativeOp => serde.createExec(nativeOp, op))
+ val nativeOpOpt =
+ if (op.children.nonEmpty &&
op.children.forall(_.isInstanceOf[CometNativeExec])) {
+ val childOp =
op.children.map(_.asInstanceOf[CometNativeExec].nativeOp)
+ childOp.foreach(builder.addChildren)
+ serde.convert(op, builder, childOp: _*)
+ } else {
+ serde.convert(op, builder)
+ }
+ return nativeOpOpt.map { nativeOp =>
+ val exec = serde.createExec(nativeOp, op)
+ rollUpInfoMessages(op, exec)
+ exec
Review Comment:
Thanks, I implemented something similar just now
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]