Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import org.apache.spark.sql.comet.{CometCollectLimitExec, CometColumnarToRowExec
import org.apache.spark.sql.comet.execution.shuffle.{CometColumnarShuffle, CometShuffleExchangeExec}
import org.apache.spark.sql.execution.{ColumnarToRowExec, RowToColumnarExec, SparkPlan}
import org.apache.spark.sql.execution.adaptive.QueryStageExec
import org.apache.spark.sql.execution.exchange.ReusedExchangeExec

import org.apache.comet.CometConf

Expand Down Expand Up @@ -112,6 +113,7 @@ case class EliminateRedundantTransitions(session: SparkSession) extends Rule[Spa
private def hasCometNativeChild(op: SparkPlan): Boolean = {
op match {
case c: QueryStageExec => hasCometNativeChild(c.plan)
case c: ReusedExchangeExec => hasCometNativeChild(c.child)
case _ => op.exists(_.isInstanceOf[CometPlan])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import org.apache.spark.sql.comet.util.{Utils => CometUtils}
import org.apache.spark.sql.errors.QueryExecutionErrors
import org.apache.spark.sql.execution.{CodegenSupport, ColumnarToRowTransition, SparkPlan, SQLExecution}
import org.apache.spark.sql.execution.adaptive.BroadcastQueryStageExec
import org.apache.spark.sql.execution.exchange.ReusedExchangeExec
import org.apache.spark.sql.execution.metric.{SQLMetric, SQLMetrics}
import org.apache.spark.sql.execution.vectorized.{ConstantColumnVector, WritableColumnVector}
import org.apache.spark.sql.types._
Expand Down Expand Up @@ -172,6 +173,7 @@ case class CometColumnarToRowExec(child: SparkPlan)
op match {
case b: CometBroadcastExchangeExec => Some(b)
case b: BroadcastQueryStageExec => findCometBroadcastExchange(b.plan)
case b: ReusedExchangeExec => findCometBroadcastExchange(b.child)
case _ => op.children.collectFirst(Function.unlift(findCometBroadcastExchange))
}
}
Expand Down
Loading