| 54 | } |
| 55 | |
| 56 | Result<std::unique_ptr<substrait::Plan>> PlanToProto( |
| 57 | const acero::Declaration& declr, ExtensionSet* ext_set, |
| 58 | const ConversionOptions& conversion_options) { |
| 59 | auto subs_plan = std::make_unique<substrait::Plan>(); |
| 60 | subs_plan->set_allocated_version(CreateVersion().release()); |
| 61 | auto plan_rel = std::make_unique<substrait::PlanRel>(); |
| 62 | auto rel_root = std::make_unique<substrait::RelRoot>(); |
| 63 | ARROW_ASSIGN_OR_RAISE(auto rel, ToProto(declr, ext_set, conversion_options)); |
| 64 | rel_root->set_allocated_input(rel.release()); |
| 65 | plan_rel->set_allocated_root(rel_root.release()); |
| 66 | subs_plan->mutable_relations()->AddAllocated(plan_rel.release()); |
| 67 | RETURN_NOT_OK(AddExtensionSetToPlan(*ext_set, subs_plan.get())); |
| 68 | return subs_plan; |
| 69 | } |
| 70 | |
| 71 | } // namespace engine |
| 72 | } // namespace arrow |
nothing calls this directly
no test coverage detected