Github user brkyvz commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16716#discussion_r98141759
  
    --- 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 --
    
    Oh shoot. I should definitely leave those out because they are trigger 
specific right?
    I should only keep the stateOperator part


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to