Github user tdas commented on a diff in the pull request:
https://github.com/apache/spark/pull/16716#discussion_r98140040
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/streaming/StreamingQueryStatusAndProgressSuite.scala
---
@@ -171,6 +174,47 @@ class StreamingQueryStatusAndProgressSuite extends
StreamTest {
query.stop()
}
}
+
+ test("SPARK-19378: Continue reporting stateOp and eventTime metrics even
if there is no data") {
+ import testImplicits._
+
+ withSQLConf(SQLConf.STREAMING_NO_DATA_PROGRESS_EVENT_INTERVAL.key ->
"10") {
+ val inputData = MemoryStream[(Int, String)]
+
+ val query = inputData.toDS().toDF("value", "time")
+ .select('value, 'time.cast("timestamp"))
+ .withWatermark("time", "10 seconds")
+ .groupBy($"value")
+ .agg(count("*"))
+ .writeStream
+ .queryName("metric_continuity")
+ .format("memory")
+ .outputMode("complete")
+ .start()
+ try {
+ inputData.addData((1, "2017-01-26 01:00:00"), (2, "2017-01-26
01:00:02"))
+ query.processAllAvailable()
+
+ val progress = query.lastProgress
+ assert(progress.eventTime.size() > 1)
+ assert(progress.stateOperators.length > 0)
+ // Should emit new progresses every 10 ms, but we could be facing
a slow Jenkins
+ eventually(timeout(1 minute)) {
+ val nextProgress = query.lastProgress
+ assert(nextProgress.timestamp !== progress.timestamp)
+ assert(nextProgress.numInputRows === 0)
+ assert(nextProgress.eventTime.get("min") === "2017-01-26
01:00:00")
--- End diff --
This does not make sense. if there is no data in the last trigger, the min,
max, avg timestamps cannot be different.
and what about the watermark?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]