WweiL commented on code in PR #41558:
URL: https://github.com/apache/spark/pull/41558#discussion_r1231407237


##########
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala:
##########
@@ -462,6 +462,15 @@ abstract class KeyValueGroupedDataset[K, V] private[sql] 
() extends Serializable
       UdfUtils.coGroupFunctionToScalaFunc(f))(encoder)
   }
 
+  protected def flatMapGroupsWithStateHelper[S: Encoder, U: Encoder](
+      outputMode: OutputMode,
+      timeoutConf: GroupStateTimeout,
+      initialState: KeyValueGroupedDataset[K, S],

Review Comment:
   I feel this helper method shouldn't appear there. Is this change because of 
this comment? https://github.com/apache/spark/pull/41558#discussion_r1227337649
   
   I actually think it's good to use the original implementation, i.e. have a 
dedicated `flatMapGroupsWithState` and `mapGroupsWIthState` that handles all 
cases respectively, this also follows the original API design: 
https://github.com/apache/spark/blob/28869401eff8fcd94aa68d662fdd4d3dbe2f58af/sql/core/src/main/scala/org/apache/spark/sql/KeyValueGroupedDataset.scala
   
   But we could also just use an ultimate `flatMapGroupsWithState` that 
achieves the same goal as @zhenlineo suggested and still delete this helper 
method.
   
   Sorry for the back and forth. @zhenlineo @bogao007 wdyt? 



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