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

Function AddPassFactory

cpp/src/arrow/engine/substrait/serde_test.cc:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92namespace engine {
93
94Status AddPassFactory(
95 const std::string& factory_name,
96 acero::ExecFactoryRegistry* registry = acero::default_exec_factory_registry()) {
97 using acero::ExecNode;
98 using acero::ExecNodeOptions;
99 using acero::ExecPlan;
100 using compute::ExecBatch;
101 struct PassNode : public acero::MapNode {
102 static Result<ExecNode*> Make(ExecPlan* plan, std::vector<ExecNode*> inputs,
103 const acero::ExecNodeOptions& options) {
104 RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 1, "PassNode"));
105 return plan->EmplaceNode<PassNode>(plan, inputs, inputs[0]->output_schema());
106 }
107
108 PassNode(ExecPlan* plan, std::vector<ExecNode*> inputs,
109 std::shared_ptr<Schema> output_schema)
110 : MapNode(plan, inputs, output_schema) {}
111
112 const char* kind_name() const override { return "PassNode"; }
113 Result<ExecBatch> ProcessBatch(ExecBatch batch) override { return batch; }
114 };
115 return registry->AddFactory(factory_name, PassNode::Make);
116}
117
118const auto kNullConsumer = std::make_shared<acero::NullSinkNodeConsumer>();
119

Callers

nothing calls this directly

Calls 2

AddFactoryMethod · 0.80

Tested by

no test coverage detected