anishshri-db commented on code in PR #49978: URL: https://github.com/apache/spark/pull/49978#discussion_r1957732285
########## sql/api/src/main/scala/org/apache/spark/sql/streaming/ListState.scala: ########## @@ -24,21 +24,53 @@ import org.apache.spark.annotation.Evolving */ trait ListState[S] extends Serializable { - /** Whether state exists or not. */ + /** + * Function to check whether state exists for current grouping key or not. + * + * @return - true if state exists, false otherwise. + */ def exists(): Boolean /** Get the state value. An empty iterator is returned if no value exists. */ + + /** + * Function to get the list of elements in the state as an iterator. If the state does not exist, + * an empty iterator is returned. + * Note that its always recommended to check whether the state exists or not by calling exists() Review Comment: Done ########## sql/api/src/main/scala/org/apache/spark/sql/streaming/ValueState.scala: ########## @@ -27,22 +27,33 @@ import org.apache.spark.annotation.Evolving */ trait ValueState[S] extends Serializable { - /** Whether state exists or not. */ + /** + * Function to check whether state exists for current grouping key or not. + * + * @return - true if state exists, false otherwise. + */ def exists(): Boolean /** - * Get the state value if it exists or return null otherwise. + * Get the state value for current grouping key if it exists or return null otherwise. Review Comment: Done -- 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