cloud-fan commented on code in PR #39624:
URL: https://github.com/apache/spark/pull/39624#discussion_r1132200043


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AdaptiveSparkPlanExec.scala:
##########
@@ -220,10 +221,23 @@ case class AdaptiveSparkPlanExec(
   }
 
   private def getExecutionId: Option[Long] = {
-    // If the `QueryExecution` does not match the current execution ID, it 
means the execution ID
-    // belongs to another (parent) query, and we should not call update UI in 
this query.
     
Option(context.session.sparkContext.getLocalProperty(SQLExecution.EXECUTION_ID_KEY))
-      .map(_.toLong).filter(SQLExecution.getQueryExecution(_) eq context.qe)
+      .map(_.toLong)
+  }
+
+  private lazy val shouldUpdatePlan: Boolean = {
+    // There are two cases that should not update plan:
+    // 1. When executing subqueries, we can't update the query plan in the UI 
as the
+    //    UI doesn't support partial update yet. However, the subquery may 
have been
+    //    optimized into a different plan and we must let the UI know the SQL 
metrics
+    //    of the new plan nodes, so that it can track the valid accumulator 
updates later
+    //    and display SQL metrics correctly.
+    // 2. If the `QueryExecution` does not match the current execution ID, it 
means the execution
+    //    ID belongs to another (parent) query, and we should not call update 
UI in this query.

Review Comment:
   shall we mention that this can happen with table cache?



-- 
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

Reply via email to