andygrove commented on code in PR #2856:
URL: https://github.com/apache/datafusion-comet/pull/2856#discussion_r2599240337
##########
spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala:
##########
@@ -206,27 +205,20 @@ case class CometExecRule(session: SparkSession) extends
Rule[SparkPlan] {
// broadcast exchange is forced to be enabled by Comet config.
case plan if plan.children.exists(_.isInstanceOf[BroadcastExchangeExec])
=>
val newChildren = plan.children.map {
- case b: BroadcastExchangeExec
- if isCometNative(b.child) &&
- CometConf.COMET_EXEC_BROADCAST_EXCHANGE_ENABLED.get(conf) =>
- operator2Proto(b) match {
- case Some(nativeOp) =>
- val cometOp = CometBroadcastExchangeExec(b, b.output, b.mode,
b.child)
- CometSinkPlaceHolder(nativeOp, b, cometOp)
- case None => b
- }
+ case b: BroadcastExchangeExec =>
+ convertToCometIfAllChildrenAreNative(b,
CometBroadcastExchangeExec).getOrElse(b)
case other => other
}
if (!newChildren.exists(_.isInstanceOf[BroadcastExchangeExec])) {
val newPlan = convertNode(plan.withNewChildren(newChildren))
if (isCometNative(newPlan) || isCometBroadCastForceEnabled(conf)) {
newPlan
} else {
- if (isCometNative(newPlan)) {
Review Comment:
This `if` expression always evaluates to `false`, so the contained code
never ran
##########
spark/src/main/scala/org/apache/comet/rules/CometExecRule.scala:
##########
@@ -206,27 +205,20 @@ case class CometExecRule(session: SparkSession) extends
Rule[SparkPlan] {
// broadcast exchange is forced to be enabled by Comet config.
case plan if plan.children.exists(_.isInstanceOf[BroadcastExchangeExec])
=>
val newChildren = plan.children.map {
- case b: BroadcastExchangeExec
- if isCometNative(b.child) &&
- CometConf.COMET_EXEC_BROADCAST_EXCHANGE_ENABLED.get(conf) =>
- operator2Proto(b) match {
- case Some(nativeOp) =>
- val cometOp = CometBroadcastExchangeExec(b, b.output, b.mode,
b.child)
- CometSinkPlaceHolder(nativeOp, b, cometOp)
- case None => b
- }
+ case b: BroadcastExchangeExec =>
+ convertToCometIfAllChildrenAreNative(b,
CometBroadcastExchangeExec).getOrElse(b)
case other => other
}
if (!newChildren.exists(_.isInstanceOf[BroadcastExchangeExec])) {
val newPlan = convertNode(plan.withNewChildren(newChildren))
if (isCometNative(newPlan) || isCometBroadCastForceEnabled(conf)) {
newPlan
} else {
- if (isCometNative(newPlan)) {
Review Comment:
This `if` expression always evaluates to `false`, so the contained code
never ran
--
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]