tdas commented on a change in pull request #27333: [SPARK-29438][SS][FOLLOWUP] 
Add regression tests for Streaming Aggregation and flatMapGroupsWithState
URL: https://github.com/apache/spark/pull/27333#discussion_r373321424
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/streaming/FlatMapGroupsWithStateSuite.scala
 ##########
 @@ -1019,6 +1019,76 @@ class FlatMapGroupsWithStateSuite extends 
StateStoreMetricsTest {
       spark.createDataset(Seq(("a", 2), ("b", 1))).toDF)
   }
 
+  testWithAllStateVersions("SPARK-29438: ensure UNION doesn't lead 
(flat)MapGroupsWithState" +
+    " to use shifted partition IDs") {
+    // Function to maintain running count up to 2, and then remove the count
+    // Returns the data and the count (-1 if count reached beyond 2 and state 
was just removed)
+    val stateFunc = (key: String, values: Iterator[String], state: 
GroupState[RunningCount]) => {
+      assertCanGetProcessingTime { state.getCurrentProcessingTimeMs() >= 0 }
+      assertCannotGetWatermark { state.getCurrentWatermarkMs() }
 
 Review comment:
   this test does not need these two checks. other tests already test this.

----------------------------------------------------------------
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]

Reply via email to