indigophox commented on code in PR #34817:
URL: https://github.com/apache/arrow/pull/34817#discussion_r1163272958


##########
cpp/src/arrow/flight/sql/server.cc:
##########
@@ -423,6 +494,91 @@ arrow::Result<Result> 
PackActionResult(ActionCreatePreparedStatementResult resul
   return PackActionResult(pb_result);
 }
 
+arrow::Result<Result> PackActionResult(ActionSetSessionOptionsResult result) {
+  pb::sql::ActionSetSessionOptionsResult pb_result;
+  for (SetSessionOptionResult& res : result.results) {
+    switch (res) {
+      case SetSessionOptionResult::kUnspecified:
+        pb_result.add_results(
+            
pb::sql::ActionSetSessionOptionsResult::SET_SESSION_OPTION_RESULT_UNSPECIFIED);
+        break;
+      case SetSessionOptionResult::kOk:
+        pb_result.add_results(
+            
pb::sql::ActionSetSessionOptionsResult::SET_SESSION_OPTION_RESULT_OK);
+        break;
+      case SetSessionOptionResult::kInvalidResult:
+        pb_result.add_results(
+            
pb::sql::ActionSetSessionOptionsResult::SET_SESSION_OPTION_RESULT_INVALID_VALUE);
+        break;
+      case SetSessionOptionResult::kError:
+        pb_result.add_results(
+            
pb::sql::ActionSetSessionOptionsResult::SET_SESSION_OPTION_RESULT_ERROR);
+        break;
+    }
+  }
+  return PackActionResult(pb_result);
+}
+
+arrow::Result<Result> PackActionResult(ActionGetSessionOptionsResult result) {
+  pb::sql::ActionGetSessionOptionsResult pb_result;
+  for (const SessionOption& in_opt : result.session_options) {
+    pb::sql::SessionOption& opt = *pb_result.add_session_options();

Review Comment:
   > Also, no Protobuf types can be placed in types.h. They can only be in an 
internal header.
   
   To confirm, you mean regarding moving the enum/etc field conversion logic to 
the type decls, not existing code in the PR?  No reason there couldn't be an 
`internal_types.h` or similar, and a lot of them are in the various 
`client/server.{h,cc}` anyways.



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

Reply via email to