ericm-db commented on code in PR #48205:
URL: https://github.com/apache/spark/pull/48205#discussion_r1772317187


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/state/StateDataSource.scala:
##########
@@ -153,10 +154,21 @@ class StateDataSource extends TableProvider with 
DataSourceRegister with Logging
           "No state variable names are defined for the transformWithState 
operator")
       }
 
+      val twsOperatorProperties = 
TransformWithStateOperatorProperties.fromJson(operatorProperties)
+      val timeMode = twsOperatorProperties.timeMode
+      if (sourceOptions.readRegisteredTimers && timeMode == 
TimeMode.None().toString) {
+        throw StateDataSourceErrors.invalidOptionValue(READ_REGISTERED_TIMERS,
+          "Registered timers are not available in TimeMode=None.")
+      }
+

Review Comment:
   ```suggestion
         var stateVarName = if (sourceOptions.readRegisteredTimers) {
           if (timeMode == TimeMode.None().toString) {
             throw 
StateDataSourceErrors.invalidOptionValue(READ_REGISTERED_TIMERS,
               "Registered timers are not available in TimeMode=None.")
             }
             TimerStateUtils.getTimerStateVarName(timeMode)
         } else {
           sourceOptions.stateVarName.get
         }
   
   ```



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