cloud-fan commented on a change in pull request #32816:
URL: https://github.com/apache/spark/pull/32816#discussion_r696352301
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala
##########
@@ -640,29 +660,44 @@ case class AdaptiveSparkPlanExec(
* Re-optimize and run physical planning on the current logical plan based
on the latest stats.
*/
private def reOptimize(
- logicalPlan: LogicalPlan): (SparkPlan, LogicalPlan) =
context.qe.withCteMap {
+ logicalPlan: LogicalPlan): (Seq[SparkPlan], LogicalPlan) =
context.qe.withCteMap {
logicalPlan.invalidateStatsCache()
val optimized = optimizer.execute(logicalPlan)
val sparkPlan =
context.session.sessionState.planner.plan(ReturnAnswer(optimized)).next()
- val newPlan = applyPhysicalRules(
+
+ val optimizedPhysicalPlan = applyPhysicalRules(
sparkPlan,
- preprocessingRules ++ queryStagePreparationRules,
+ preprocessingRules ++ queryStagePreparationRules(),
Some((planChangeLogger, "AQE Replanning")))
+ val optimizedWithSkewedJoin =
+ AQEUtils.ensureRequiredDistribution(
+ applyPhysicalRules(
Review comment:
shall we follow `optimizeQueryStage` and move this to a new method?
```
def prepareQueryStages(optimizeSkewJoin: Boolean) = {
...
}
```
--
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]