You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "lidavidm (via GitHub)" <gi...@apache.org> on 2023/04/07 12:25:05 UTC

[GitHub] [arrow] lidavidm commented on a diff in pull request #34817: GH-34865: [C++][Flight RPC] Add Session management messages, Location URI path accessors

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


##########
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:
   The version of the Google C++ guidelines that Arrow was developed with prefers `T*` to `T&`.



-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org