dongjoon-hyun commented on code in PR #44013: URL: https://github.com/apache/spark/pull/44013#discussion_r1411754598
########## sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala: ########## @@ -713,10 +735,15 @@ case class AdaptiveSparkPlanExec( private def reOptimize(logicalPlan: LogicalPlan): Option[(SparkPlan, LogicalPlan)] = { try { logicalPlan.invalidateStatsCache() - val optimized = optimizer.execute(logicalPlan) - val sparkPlan = context.session.sessionState.planner.plan(ReturnAnswer(optimized)).next() - val newPlan = applyPhysicalRules( - applyQueryPostPlannerStrategyRules(sparkPlan), + val optimized = withRuleContext { + optimizer.execute(logicalPlan) + } Review Comment: I'm wondering if we can make it as one-liner? Or, did `scalastyle` for `scalafmt` complain for this one-liner style? ```scala val optimized = withRuleContext { optimizer.execute(logicalPlan) } ``` -- 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