uncleGen commented on a change in pull request #28391:
URL: https://github.com/apache/spark/pull/28391#discussion_r434380758
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala
##########
@@ -433,9 +433,13 @@ class StreamingQueryListenerSuite extends StreamTest with
BeforeAndAfter {
}
try {
+ val noDataProgressIntervalKey =
SQLConf.STREAMING_NO_DATA_PROGRESS_EVENT_INTERVAL.key
spark.streams.addListener(listener)
testStream(df, OutputMode.Append)(
- StartStream(Trigger.ProcessingTime(100), triggerClock = clock),
+ StartStream(
+ Trigger.ProcessingTime(100),
+ triggerClock = clock,
+ Map(noDataProgressIntervalKey -> "100")),
Review comment:
set "noDataProgressIntervalKey" to 100. After advance manual clock at
batch 3, it will report an empty progress event.
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryListenerSuite.scala
##########
@@ -464,7 +468,49 @@ class StreamingQueryListenerSuite extends StreamTest with
BeforeAndAfter {
}
}
- private def testReplayListenerBusWithBorkenEventJsons(
+ test("SPARK-31593: remove unnecessary streaming query progress update") {
+ withSQLConf(SQLConf.STREAMING_NO_DATA_PROGRESS_EVENT_INTERVAL.key ->
"100") {
+ @volatile var numProgressEvent = 0
+ val listener = new StreamingQueryListener {
+ override def onQueryStarted(event: QueryStartedEvent): Unit = {}
+ override def onQueryProgress(event: QueryProgressEvent): Unit = {
+ numProgressEvent += 1
+ }
+ override def onQueryTerminated(event: QueryTerminatedEvent): Unit = {}
+ }
+ spark.streams.addListener(listener)
+
+ def checkProgressEvent(count: Int): StreamAction = {
+ AssertOnQuery { _ =>
Review comment:
add an inner function to simplify test.
----------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]