anishshri-db commented on code in PR #45674:
URL: https://github.com/apache/spark/pull/45674#discussion_r1548590607


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StatefulProcessorHandleImpl.scala:
##########
@@ -103,22 +113,35 @@ class StatefulProcessorHandleImpl(
 
   private var currState: StatefulProcessorHandleState = CREATED
 
-  private def verify(condition: => Boolean, msg: String): Unit = {
-    if (!condition) {
-      throw new IllegalStateException(msg)
+  private val ttlExpirationMs =
+    if (ttlMode == TTLMode.ProcessingTimeTTL()) {
+      batchTimestampMs.get
+    } else if (ttlMode == TTLMode.EventTimeTTL()) {
+      eventTimeWatermarkMs.get
+    } else {
+    -1

Review Comment:
   nit: indent seems iff again ?
   
   Btw - should we just throw an exception here ?



##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/StatefulProcessorHandleImpl.scala:
##########
@@ -103,22 +113,35 @@ class StatefulProcessorHandleImpl(
 
   private var currState: StatefulProcessorHandleState = CREATED
 
-  private def verify(condition: => Boolean, msg: String): Unit = {
-    if (!condition) {
-      throw new IllegalStateException(msg)
+  private val ttlExpirationMs =
+    if (ttlMode == TTLMode.ProcessingTimeTTL()) {
+      batchTimestampMs.get
+    } else if (ttlMode == TTLMode.EventTimeTTL()) {
+      eventTimeWatermarkMs.get
+    } else {
+    -1

Review Comment:
   nit: indent seems off again ?
   
   Btw - should we just throw an exception here ?



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to