tdas commented on a change in pull request #32938:
URL: https://github.com/apache/spark/pull/32938#discussion_r655746835



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/streaming/TestGroupState.scala
##########
@@ -0,0 +1,68 @@
+package org.apache.spark.sql.streaming
+
+import org.apache.spark.api.java.Optional
+import org.apache.spark.sql.execution.streaming.GroupStateImpl
+import org.apache.spark.sql.execution.streaming.GroupStateImpl._
+
+/**
+ * The extended version of [[GroupState]] interface with extra getters of 
state machine fields
+ * to improve testability of the [[GroupState]] implementations
+ * which inherit from the extended interface.
+ *
+ * @tparam S User-defined type of the state to be stored for each group. Must 
be encodable into
+ *           Spark SQL types (see `Encoder` for more details).
+ */

Review comment:
       Since the original GroupState API is still marked as experimental (I 
know it does make sense, but that's for a different discussion), lets be 
consistent and add the same annotations to this as well.  similarly, also add 
`@since 3.2.0` 
   
   and would be nice if you could add Java and Scala code snippets of how to 
use these traits. It's not entirely obvious how to use TestGroupState. See 
GroupState to find out how to add code snippets. This is how it looks later - 
https://spark.apache.org/docs/2.4.0/api/scala/index.html#org.apache.spark.sql.streaming.GroupState




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

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