MCPcopy Create free account
hub / github.com/apache/arrow / ExecuteSubstraitUpdate

Method ExecuteSubstraitUpdate

cpp/src/arrow/flight/sql/client.cc:221–246  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221arrow::Result<int64_t> FlightSqlClient::ExecuteSubstraitUpdate(
222 const FlightCallOptions& options, const SubstraitPlan& plan,
223 const Transaction& transaction) {
224 flight_sql_pb::CommandStatementSubstraitPlan command;
225 SetPlan(plan, command.mutable_plan());
226 if (transaction.is_valid()) {
227 command.set_transaction_id(transaction.transaction_id());
228 }
229
230 ARROW_ASSIGN_OR_RAISE(FlightDescriptor descriptor,
231 GetFlightDescriptorForCommand(command));
232
233 ARROW_ASSIGN_OR_RAISE(auto result, DoPut(options, descriptor, arrow::schema({})));
234
235 std::shared_ptr<Buffer> metadata;
236 ARROW_RETURN_NOT_OK(result.reader->ReadMetadata(&metadata));
237 ARROW_RETURN_NOT_OK(result.writer->Close());
238
239 flight_sql_pb::DoPutUpdateResult update_result;
240 if (!update_result.ParseFromArray(metadata->data(),
241 static_cast<int>(metadata->size()))) {
242 return Status::Invalid("Unable to parse DoPutUpdateResult");
243 }
244
245 return update_result.record_count();
246}
247
248arrow::Result<int64_t> FlightSqlClient::ExecuteIngest(
249 const FlightCallOptions& options, const std::shared_ptr<RecordBatchReader>& reader,

Callers 2

ValidateTransactionsMethod · 0.80
acero_test.ccFile · 0.80

Calls 7

SetPlanFunction · 0.85
InvalidFunction · 0.50
is_validMethod · 0.45
ReadMetadataMethod · 0.45
CloseMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by 1

ValidateTransactionsMethod · 0.64