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

Function ExecPlan_run

r/src/compute-exec.cpp:227–247  ·  view source on GitHub ↗

[[acero::export]]

Source from the content-addressed store, hash-verified

225
226// [[acero::export]]
227std::shared_ptr<ExecPlanReader> ExecPlan_run(
228 const std::shared_ptr<acero::ExecPlan>& plan,
229 const std::shared_ptr<acero::ExecNode>& final_node, cpp11::strings metadata) {
230 // For now, don't require R to construct SinkNodes.
231 // Instead, just pass the node we should collect as an argument.
232 arrow::AsyncGenerator<std::optional<compute::ExecBatch>> sink_gen;
233
234 MakeExecNodeOrStop("sink", plan.get(), {final_node.get()},
235 acero::SinkNodeOptions{&sink_gen});
236
237 StopIfNotOk(plan->Validate());
238
239 // Attach metadata to the schema
240 auto out_schema = final_node->output_schema();
241 if (metadata.size() > 0) {
242 auto kv = strings_to_kvm(metadata);
243 out_schema = out_schema->WithMetadata(kv);
244 }
245
246 return std::make_shared<ExecPlanReader>(plan, out_schema, sink_gen);
247}
248
249// [[acero::export]]
250std::string ExecPlan_ToString(const std::shared_ptr<acero::ExecPlan>& plan) {

Callers 1

_arrow_ExecPlan_runFunction · 0.85

Calls 7

MakeExecNodeOrStopFunction · 0.85
StopIfNotOkFunction · 0.85
strings_to_kvmFunction · 0.85
getMethod · 0.45
ValidateMethod · 0.45
sizeMethod · 0.45
WithMetadataMethod · 0.45

Tested by

no test coverage detected