cloud-fan commented on a change in pull request #32816:
URL: https://github.com/apache/spark/pull/32816#discussion_r692181227
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -656,13 +687,54 @@ case class AdaptiveSparkPlanExec(
// node to prevent the loss of the `BroadcastExchangeExec` node in DPP
subquery.
// Here, we also need to avoid to insert the `BroadcastExchangeExec` node
when the newPlan
// is already the `BroadcastExchangeExec` plan after apply the
`LogicalQueryStageStrategy` rule.
- val finalPlan = currentPhysicalPlan match {
+ def updateBroadcastExchange(plan: SparkPlan): SparkPlan =
currentPhysicalPlan match {
case b: BroadcastExchangeLike
- if (!newPlan.isInstanceOf[BroadcastExchangeLike]) =>
b.withNewChildren(Seq(newPlan))
- case _ => newPlan
+ if (!plan.isInstanceOf[BroadcastExchangeLike]) =>
b.withNewChildren(Seq(plan))
+ case _ => plan
}
- (finalPlan, optimized)
+ val optimizedWithSkewedJoin = applyPhysicalRules(
+ optimizedPhysicalPlan,
+ optimizeSkewedJoinWithExtraShuffleRules,
+ Some((planChangeLogger, "AQE Optimize Skewed Join With Extra Shuffle"))
+ )
+ val validatedWithSkewedJoin =
+ checkDistribution(
+ optimizedWithSkewedJoin,
+ optimizedPhysicalPlan,
+ isFinalStage(optimizedWithSkewedJoin),
Review comment:
previously we only validate in the query optimization phase, not
preparation phase.
--
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]