bogao007 commented on code in PR #47133:
URL: https://github.com/apache/spark/pull/47133#discussion_r1663053717
##########
python/pyspark/sql/streaming/StateMessage.proto:
##########
@@ -0,0 +1,98 @@
+syntax = "proto3";
+
+package pyspark.sql.streaming;
+
+message StateRequest {
+ int32 version = 1;
+ oneof method {
+ StatefulProcessorCall statefulProcessorCall = 2;
+ StateVariableRequest stateVariableRequest = 3;
+ ImplicitGroupingKeyRequest implicitGroupingKeyRequest = 4;
+ }
+}
+
+message StateResponse {
+ int32 statusCode = 1;
+ string errorMessage = 2;
+}
+
+message StatefulProcessorCall {
+ oneof method {
+ SetHandleState setHandleState = 1;
+ StateCallCommand getValueState = 2;
+ StateCallCommand getListState = 3;
+ StateCallCommand getMapState = 4;
+ }
+}
+
+message StateVariableRequest {
+ oneof method {
+ ValueStateCall valueStateCall = 1;
+ ListStateCall listStateCall = 2;
+ }
+}
+
+message ImplicitGroupingKeyRequest {
+ oneof method {
+ SetImplicitKey setImplicitKey = 1;
+ RemoveImplicitKey removeImplicitKey = 2;
+ }
+}
+
+message StateCallCommand {
+ string stateName = 1;
+ string schema = 2;
+}
+
+message ValueStateCall {
+ oneof method {
+ Exists exists = 1;
+ Get get = 2;
+ Update update = 3;
+ Clear clear = 4;
+ }
+}
+
+message ListStateCall {
+ oneof method {
+ Exists exists = 1;
+ Get get = 2;
+ Clear clear = 3;
+ }
+}
+
+message SetImplicitKey {
+ string key = 1;
+}
+
+message RemoveImplicitKey {
+}
+
+message Exists {
+ string stateName = 1;
+}
+
+message Get {
+ string stateName = 1;
+}
+
+message Update {
Review Comment:
Makes sense, will update the `Update` message. For `Get`/`Exists`/`Clear`,
since they will be shared with multiple state variables, I will just keep them
as it is for now. We could have a specific message for `MapState`'s `Get`, and
keep the existing `Get` for `ValueState` and `ListState`. What do you think?
--
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]