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


##########
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:
   
   > But we could also just use an ultimate `flatMapGroupsWithState` that 
achieves the same goal as @zhenlineo suggested and still delete this helper 
method.
   It would be hard to achieve this since the original `flatMapGroupsWithState` 
methods doesn't contain a boolean to decide if it's `flatMapGroupsWithState` or 
`mapGroupsWIthState`. If we add that boolean, then it's the same as the helper 
function approach. Otherwise we have to maintain 2 different implementations
   
   



##########
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:
   > But we could also just use an ultimate `flatMapGroupsWithState` that 
achieves the same goal as @zhenlineo suggested and still delete this helper 
method.
   
   It would be hard to achieve this since the original `flatMapGroupsWithState` 
methods doesn't contain a boolean to decide if it's `flatMapGroupsWithState` or 
`mapGroupsWIthState`. If we add that boolean, then it's the same as the helper 
function approach. Otherwise we have to maintain 2 different implementations
   
   



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