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


##########
cpp/src/arrow/flight/serialization_internal.cc:
##########
@@ -376,6 +384,161 @@ Status ToPayload(const FlightDescriptor& descr, 
std::shared_ptr<Buffer>* out) {
   return Status::OK();
 }
 
+// SessionOptionValue
+
+Status FromProto(const pb::SessionOptionValue& pb_val, SessionOptionValue* 
val) {
+  switch (pb_val.option_value_case()) {
+    case pb::SessionOptionValue::OPTION_VALUE_NOT_SET:
+      return Status::Invalid("Unset SessionOptionValue found");
+    case pb::SessionOptionValue::kStringValue:
+      *val = pb_val.string_value();
+      break;
+    case pb::SessionOptionValue::kBoolValue:
+      *val = pb_val.bool_value();
+      break;
+    case pb::SessionOptionValue::kInt32Value:
+      *val = pb_val.int32_value();
+      break;
+    case pb::SessionOptionValue::kInt64Value:
+      *val = pb_val.int64_value();
+      break;
+    case pb::SessionOptionValue::kFloatValue:
+      *val = pb_val.float_value();
+      break;
+    case pb::SessionOptionValue::kDoubleValue:
+      *val = pb_val.double_value();
+      break;
+    case pb::SessionOptionValue::kStringListValue:
+      (*val).emplace<std::vector<std::string>>();
+      std::get<std::vector<std::string>>(*val).reserve(
+          pb_val.string_list_value().values_size());
+      for (const std::string& s : pb_val.string_list_value().values())
+        std::get<std::vector<std::string>>(*val).push_back(s);

Review Comment:
   Done and done.



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