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