HeartSaVioR commented on a change in pull request #25048: [SPARK-28247][SS] Fix 
flaky test "query without test harness" on ContinuousSuite 
URL: https://github.com/apache/spark/pull/25048#discussion_r301229973
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/ContinuousRateStreamSource.scala
 ##########
 @@ -82,7 +87,16 @@ class RateStreamContinuousStream(rowsPerSecond: Long, 
numPartitions: Int) extend
     RateStreamContinuousReaderFactory
   }
 
-  override def commit(end: Offset): Unit = {}
+  override def commit(end: Offset): Unit = {
+    end.asInstanceOf[RateStreamOffset].partitionToValueAndRunTimeMs.foreach {
+      case (_, ValueRunTimeMsPair(value, _)) =>
+        if (highestCommittedValue.get() < value) {
 
 Review comment:
   Thanks for pointing out! Only one writer and one reader will run 
concurrently. I'm revisiting the change, and it looks like just 
over-engineering. `volatile` would just work. If reader is reading the old 
value they just need to wait a bit more, so not strictly need to have 
atomicity. I'll make a change.

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