uncleGen commented on a change in pull request #26610: [SPARK-29973][SS] Make
`processedRowsPerSecond` calculated more accurately and meaningfully
URL: https://github.com/apache/spark/pull/26610#discussion_r349500268
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala
##########
@@ -215,6 +218,60 @@ class StreamingQueryStatusAndProgressSuite extends
StreamTest with Eventually {
}
}
+ test("SPARK-29973: Make `processedRowsPerSecond` calculated more accurately
and meaningfully") {
+ import testImplicits._
+
+ clock = new StreamManualClock
+ val inputData = MemoryStream[Int]
+ val query = inputData.toDS()
+
+ testStream(query)(
+ StartStream(Trigger.ProcessingTime(1000), triggerClock = clock),
+ AssertStreamExecThreadIsWaitingForTime(1000),
+ AdvanceManualClock(1000),
+ WaitUntilBatchProcessed,
+ AssertOnQuery(query => {
+ assert(query.lastProgress.numInputRows == 0)
+ assert(query.lastProgress.processedRowsPerSecond == 0.0d)
+ true
+ }),
+ AddData(inputData, 1, 2),
+ AssertStreamExecThreadIsWaitingForTime(2000),
+ AdvanceManualClock(1000),
+ WaitUntilBatchProcessed,
+ AssertOnQuery(query => {
+ assert(query.lastProgress.numInputRows == 2)
+ assert(query.lastProgress.processedRowsPerSecond == 2000d)
+ true
+ }),
+ StopStream
+ )
+ }
+
+ case class AssertStreamExecThreadIsWaitingForTime(targetTime: Long)
Review comment:
removed this check.
----------------------------------------------------------------
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]