indigophox commented on code in PR #34817:
URL: https://github.com/apache/arrow/pull/34817#discussion_r1252281589
##########
cpp/src/arrow/flight/sql/client.cc:
##########
@@ -802,6 +802,157 @@ ::arrow::Result<CancelResult>
FlightSqlClient::CancelQuery(
return Status::IOError("Server returned unknown result ", result.result());
}
+::arrow::Result<std::vector<SetSessionOptionResult>>
FlightSqlClient::SetSessionOptions(
+ const FlightCallOptions& options,
+ const std::vector<SessionOption>& session_options) {
+ flight_sql_pb::ActionSetSessionOptionsRequest request;
+ for (const SessionOption& in_opt : session_options) {
+ flight_sql_pb::SessionOption* opt = request.add_session_options();
+ const std::string& name = in_opt.option_name;
+ opt->set_option_name(name);
+
+ const SessionOptionValue& value = in_opt.option_value;
+ if (value.index() == std::variant_npos)
+ return Status::Invalid("Undefined SessionOptionValue type ");
+ switch (static_cast<SessionOptionValueType>(value.index())) {
Review Comment:
Probably worth doing to avoid the code duplication we'd discussed
previously—on it.
--
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]