luoyuqinlaura commented on code in PR #59964:
URL: https://github.com/apache/spark/pull/59964#discussion_r4647443179


##########
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala:
##########
@@ -981,6 +981,33 @@ abstract class SQLAppStatusListenerSuite extends 
SharedSparkSession with JsonTes
 
     assertJobs(statusStore.execution(executionId), running = Seq(0))
   }
+
+  test("SPARK-60756: onJobStart should not force a kvstore write during 
history replay") {
+    val store = new ElementTrackingStore(new InMemoryStore, sparkContext.conf)
+    val replayListener = new SQLAppStatusListener(sparkContext.conf, store, 
live = false)
+    val executionId = 1L
+    val df = createTestDataFrame
+    replayListener.onOtherEvent(SparkListenerSQLExecutionStart(
+      executionId,
+      Some(executionId),
+      "test",
+      "test",
+      df.queryExecution.toString,
+      SparkPlanInfo.fromSparkPlan(df.queryExecution.executedPlan),
+      System.currentTimeMillis(),
+      Map.empty))
+
+    replayListener.onJobStart(SparkListenerJobStart(
+      jobId = 0,
+      time = System.currentTimeMillis(),
+      stageInfos = Nil,
+      createProperties(executionId)))
+
+    intercept[NoSuchElementException] {

Review Comment:
   I kept groupBy for readability. It is a single pass over the entries, and 
the 1M-entry replay above takes about 1.1 s



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

Reply via email to