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

    https://github.com/apache/spark/pull/19495#discussion_r145282515
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/GroupStateImpl.scala
 ---
    @@ -119,32 +116,34 @@ private[sql] class GroupStateImpl[S] private(
         timeoutTimestamp = timestampMs
       }
     
    -  @throws[IllegalArgumentException]("if 'additionalDuration' is invalid")
    -  @throws[IllegalStateException]("when state is either not initialized, or 
already removed")
    -  @throws[UnsupportedOperationException](
    -    "if 'timeout' has not been enabled in [map|flatMap]GroupsWithState in 
a streaming query")
       override def setTimeoutTimestamp(timestampMs: Long, additionalDuration: 
String): Unit = {
         checkTimeoutTimestampAllowed()
         setTimeoutTimestamp(parseDuration(additionalDuration) + timestampMs)
       }
     
    -  @throws[IllegalStateException]("when state is either not initialized, or 
already removed")
    -  @throws[UnsupportedOperationException](
    -    "if 'timeout' has not been enabled in [map|flatMap]GroupsWithState in 
a streaming query")
       override def setTimeoutTimestamp(timestamp: Date): Unit = {
         checkTimeoutTimestampAllowed()
         setTimeoutTimestamp(timestamp.getTime)
       }
     
    -  @throws[IllegalArgumentException]("if 'additionalDuration' is invalid")
    -  @throws[IllegalStateException]("when state is either not initialized, or 
already removed")
    -  @throws[UnsupportedOperationException](
    -    "if 'timeout' has not been enabled in [map|flatMap]GroupsWithState in 
a streaming query")
       override def setTimeoutTimestamp(timestamp: Date, additionalDuration: 
String): Unit = {
         checkTimeoutTimestampAllowed()
         setTimeoutTimestamp(timestamp.getTime + 
parseDuration(additionalDuration))
       }
     
    +  override def getCurrentWatermarkMs(): Long = {
    +    if (!watermarkPresent) {
    +      throw new UnsupportedOperationException(
    +        "Cannot get event time watermark timestamp without enabling 
setting watermark before " +
    --- End diff --
    
    `without enabling setting watermark` sounds too convoluted. You probably 
meant `without setting watermark`?


---

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

Reply via email to