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

Function PlanToProto

cpp/src/arrow/engine/substrait/plan_internal.cc:56–69  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56Result<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

Callers

nothing calls this directly

Calls 4

CreateVersionFunction · 0.85
AddExtensionSetToPlanFunction · 0.85
releaseMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected