haiyangsun-db commented on code in PR #49560:
URL: https://github.com/apache/spark/pull/49560#discussion_r1967297789
##########
sql/connect/common/src/main/protobuf/spark/connect/relations.proto:
##########
@@ -1031,6 +1031,26 @@ message GroupMap {
// (Optional) The schema for the grouped state.
optional DataType state_schema = 10;
+
+ // Below fields are used by TransformWithState and TransformWithStateInPandas
+ // (Optional) TransformWithState related parameters.
+ optional TransformWithStateInfo transform_with_state_info = 11;
+}
+
+// Additional input parameters used for TransformWithState operator.
+message TransformWithStateInfo {
Review Comment:
`GroupMap` may also be used for a normal "flatMapGroups" without state - so
ideally we should have just one optional field in "GroupMap" such as:
```
oneof stateInfo {
MapGroupsWithStateInfo = xx;
TransformWithStateInfo = yy;
}
```
And the stateInfo would clearly indicate three different types:
1. when it is none, it is a normal "flatMapGroups"
2. when it is MapGroupsWithStateInfo, it's for "MapGroupsWithState" or
"FlatMapGroupsWithState"
3. otherwise, it's for transformWithState.
This would look better, however, it is not backward compatible.
--
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]