Skip to content

Commit

Permalink
[SPARK-48750][SQL] AQEPropagateEmptyRelation convert broadcast query …
Browse files Browse the repository at this point in the history
…stage plan to empty relation causing error
  • Loading branch information
AngersZhuuuu committed Jul 1, 2024
1 parent f49418b commit 0430322
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,16 @@ case class AdaptiveSparkPlanExec(
sideBySide(currentPhysicalPlan.treeString, newPhysicalPlan.treeString).mkString("\n")
logOnLevel(log"Plan changed:\n${MDC(QUERY_PLAN, plans)}")
cleanUpTempTags(newPhysicalPlan)
currentPhysicalPlan = newPhysicalPlan
currentPhysicalPlan = currentPhysicalPlan match {
case broadcast: BroadcastQueryStageExec =>
broadcast.plan match {
case b: BroadcastExchangeExec =>
broadcast.copy(plan = b.copy(child = newPhysicalPlan))
case ReusedExchangeExec(_, b: BroadcastExchangeExec) =>
broadcast.copy(plan = b.copy(child = newPhysicalPlan))
}
case p => p
}
currentLogicalPlan = newLogicalPlan
stagesToReplace = Seq.empty[QueryStageExec]
}
Expand Down

0 comments on commit 0430322

Please sign in to comment.