anishshri-db commented on code in PR #45674: URL: https://github.com/apache/spark/pull/45674#discussion_r1546691740
########## sql/api/src/main/scala/org/apache/spark/sql/streaming/ValueState.scala: ########## @@ -42,8 +43,22 @@ private[sql] trait ValueState[S] extends Serializable { /** Get the state if it exists as an option and None otherwise */ def getOption(): Option[S] - /** Update the value of the state. */ - def update(newState: S): Unit + /** + * Update the value of the state. + * @param newState the new value + * @param ttlDuration set the ttl to current batch processing time + * (for processing time TTL mode) plus ttlDuration + */ + def update(newState: S, ttlDuration: Duration = Duration.ZERO): Unit + + + /** + * Update the value of the state. + * + * @param newState the new value + * @param expirationMs set the ttl to expirationMs (processingTime or eventTime) Review Comment: nit: should we rename to `expirationTimeInMs` ? -- 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: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org