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



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/FlatMapGroupsWithStateExec.scala
##########
@@ -404,3 +402,72 @@ case class FlatMapGroupsWithStateExec(
     copy(child = newLeft, initialState = newRight)
 }
 
+object FlatMapGroupsWithStateExec {
+
+  def foundDuplicateInitialKeyException(): Exception = {
+    throw new IllegalArgumentException("The initial state provided contained " 
+
+      "multiple rows(state) with the same key. Make sure to de-duplicate the " 
+
+      "initial state before passing it.")
+  }
+
+  /**
+   * Special handling for when the child relation is a batch relation.
+   * If the initial state is provided, we create an instance of the 
CoGroupExec, if the initial
+   * state is not provided we create an instance of the MapGroupsExec
+   */
+  // scalastyle:off argcount
+  def forBatch(

Review comment:
       `objectName.forX()` generally implies creating instances of type 
`objectName`'s corresponding class. This is not non-intuitive. rather say 
"FlatMapGroupsWithStateExec.generateSparkPlanForBatchQueries(...)`




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