You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "jasonli-db (via GitHub)" <gi...@apache.org> on 2023/08/01 04:31:16 UTC

[GitHub] [spark] jasonli-db commented on a diff in pull request #42244: [SPARK-44591][CONNECT][WEBUI] Use jobTags in SparkListenerSQLExecutionStart to link SQL Execution IDs for Spark UI Connect page

jasonli-db commented on code in PR #42244:
URL: https://github.com/apache/spark/pull/42244#discussion_r1280097399


##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/ui/SparkConnectServerListener.scala:
##########
@@ -128,6 +126,43 @@ private[connect] class SparkConnectServerListener(
     }
   }
 
+  def onSQLExecutionStart(e: SparkListenerSQLExecutionStart): Unit = {
+    val executeJobTagOpt = e.jobTags.find {
+      case ExecuteJobTag(_) => true
+      case _ => false
+    }
+    if (executeJobTagOpt.isEmpty) {
+      return
+    }
+    val executeJobTag = executeJobTagOpt.get
+    val exec = executionList.get(executeJobTag)
+    if (exec.nonEmpty) {
+      exec.foreach { exec =>
+        exec.sqlExecId += e.executionId.toString
+        updateLiveStore(exec)
+      }
+    } else {
+      // This block guards against potential event re-ordering.

Review Comment:
   It's to guard against SQLStart and JobStart events potentially coming after an OperationClosed event. It's mirrors the one in onJobStart (which was included in the Thrift Server listener as well). See the comment here: https://github.com/apache/spark/pull/42244/files#diff-ffa4c6fbd382a52c08a0f10b7fbbd6c2d09de322f7e3145ecba464f0cda5843dR89-R92



-- 
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-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org