ulysses-you commented on a change in pull request #32816: URL: https://github.com/apache/spark/pull/32816#discussion_r701542919
########## File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala ########## @@ -640,14 +668,12 @@ 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( - sparkPlan, - preprocessingRules ++ queryStagePreparationRules, - Some((planChangeLogger, "AQE Replanning"))) + val optimizedPhysicalPlan = prepareQueryStages(sparkPlan, false) Review comment: @maryannxue Do you mean the logic if we should apply `OptimizeSkewedJoin` + `EnsureRequirements` or not moves into `OptimizeSkewedJoin` itself ? If so, we aslo need add an extra cost evaluator check in `OptimizeSkewedJoin`. Seems it' not clearer than current approach that we only evaluate the cost in one place. Am I following your thought ? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org