amaliujia commented on code in PR #38192:
URL: https://github.com/apache/spark/pull/38192#discussion_r992647666


##########
connector/connect/src/main/protobuf/spark/connect/commands.proto:
##########
@@ -62,3 +65,29 @@ message CreateScalarFunction {
     FUNCTION_LANGUAGE_SCALA = 3;
   }
 }
+
+// As writes are not directly handled during analysis and planning, they are 
modeled as commands.
+message WriteOperation {
+  Relation input = 1;
+  string format = 2;
+
+  oneof save_type {
+    string path = 3;
+    string table_name = 4;
+  }
+  string mode = 5;
+  repeated string sortColumnNames = 6;
+  repeated string partitionByColumns = 7;
+  BucketBy bucketBy = 8;
+  repeated WriteOptions options = 9;

Review Comment:
   Why just not a map<string, string>? Does proto map have a iterator (if so in 
later use it is the same as `repeated`) 



##########
connector/connect/src/main/protobuf/spark/connect/commands.proto:
##########
@@ -62,3 +65,29 @@ message CreateScalarFunction {
     FUNCTION_LANGUAGE_SCALA = 3;
   }
 }
+
+// As writes are not directly handled during analysis and planning, they are 
modeled as commands.
+message WriteOperation {
+  Relation input = 1;
+  string format = 2;
+
+  oneof save_type {
+    string path = 3;
+    string table_name = 4;
+  }
+  string mode = 5;
+  repeated string sortColumnNames = 6;
+  repeated string partitionByColumns = 7;
+  BucketBy bucketBy = 8;
+  repeated WriteOptions options = 9;

Review Comment:
   Why not just a map<string, string>? Does proto map have a iterator (if so in 
later use it is the same as `repeated`) 



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