HeartSaVioR commented on a change in pull request #26201: [SPARK-29543][SS][UI]
Init structured streaming ui
URL: https://github.com/apache/spark/pull/26201#discussion_r348355432
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQuerySuite.scala
##########
@@ -1129,6 +1207,17 @@ class StreamingQuerySuite extends StreamTest with
BeforeAndAfter with Logging wi
}
}
+ /** Returns the query summary at the end of the first trigger of streaming
DF */
+ private def getQuerySummary(streamingDF: DataFrame): QuerySummary = {
+ try {
+ val q =
streamingDF.writeStream.format("memory").queryName("test").start()
+ q.processAllAvailable()
+ q.getQuerySummary
+ } finally {
+ spark.streams.active.map(_.stop())
Review comment:
Let's deduplicate with getFirstProgress; have a new private method returning
StreamingQuery, with stopping query.
Btw, personally I don't prefer side-effect like stopping all active queries
in session while the method only runs one, but given it's just copied from
existing code, OK to leave as it is.
----------------------------------------------------------------
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]