cloud-fan commented on code in PR #49715:
URL: https://github.com/apache/spark/pull/49715#discussion_r1944332029
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala:
##########
@@ -268,25 +276,23 @@ case class AdaptiveSparkPlanExec(
def finalPhysicalPlan: SparkPlan = withFinalPlanUpdate(identity)
- private def getFinalPhysicalPlan(): SparkPlan = lock.synchronized {
- if (isFinalPlan) return currentPhysicalPlan
-
+ /**
+ * Run `fun` on finalized physical plan
+ */
+ def withFinalPlanUpdate[T](fun: SparkPlan => T): T = lock.synchronized {
+ _isFinalPlan = false
Review Comment:
In this case we construct `QueryResultStageExec` directly and won't
re-optimize it:
https://github.com/apache/spark/pull/49715/files#diff-ec42cd27662f3f528832c298a60fffa1d341feb04aa1d8c80044b70cbe0ebbfcR536
--
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]