| 80 | } |
| 81 | |
| 82 | Status ReadResult(ResultStream* results, google::protobuf::Message* message) { |
| 83 | ARROW_ASSIGN_OR_RAISE(auto result, results->Next()); |
| 84 | if (!result) { |
| 85 | return Status::IOError("Server did not return a result for ", message->GetTypeName()); |
| 86 | } |
| 87 | |
| 88 | google::protobuf::Any container; |
| 89 | if (!container.ParseFromArray(result->body->data(), |
| 90 | static_cast<int>(result->body->size()))) { |
| 91 | return Status::IOError("Unable to parse Any (expecting ", message->GetTypeName(), |
| 92 | ")"); |
| 93 | } |
| 94 | if (!container.UnpackTo(message)) { |
| 95 | return Status::IOError("Unable to unpack Any (expecting ", message->GetTypeName(), |
| 96 | ")"); |
| 97 | } |
| 98 | return Status::OK(); |
| 99 | } |
| 100 | |
| 101 | arrow::Result<std::shared_ptr<Buffer>> BindParameters(FlightClient* client, |
| 102 | const FlightCallOptions& options, |