dongjoon-hyun commented on a change in pull request #28097:
[SPARK-31325][SQL][Web UI] Control a plan explain mode in the events of SQL
listeners via SQLConf
URL: https://github.com/apache/spark/pull/28097#discussion_r402474058
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/ui/SQLAppStatusListenerSuite.scala
##########
@@ -317,6 +317,40 @@ class SQLAppStatusListenerSuite extends
SharedSparkSession with JsonTestUtils
checkAnswer(statusStore.executionMetrics(executionId),
accumulatorUpdates.mapValues(_ * 11))
}
+ test("control a plan explain mode in listeners via SQLConf") {
+
+ def checkPlanDescription(mode: String, expected: Seq[String]): Unit = {
+ var checkDone = false
+ val listener = new SparkListener {
+ override def onOtherEvent(event: SparkListenerEvent): Unit = {
+ event match {
+ case SparkListenerSQLExecutionStart(_, _, _, planDescription, _,
_) =>
+ assert(expected.forall(planDescription.contains))
+ checkDone = true
+ case _ => // ignore other events
+ }
+ }
+ }
+ spark.sparkContext.addSparkListener(listener)
+ withSQLConf(SQLConf.UI_EXPLAIN_MODE.key -> mode) {
+ createTestDataFrame.collect()
+ spark.sparkContext.listenerBus.waitUntilEmpty()
+ assert(checkDone)
+ spark.sparkContext.removeSparkListener(listener)
Review comment:
Do we need to use `finally` to isolate the failure at line 338 from the
other UTs?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]