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

Method Make

cpp/src/arrow/acero/filter_node.cc:49–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47 filter_(std::move(filter)) {}
48
49 static Result<ExecNode*> Make(ExecPlan* plan, std::vector<ExecNode*> inputs,
50 const ExecNodeOptions& options) {
51 RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 1, "FilterNode"));
52 auto schema = inputs[0]->output_schema();
53
54 const auto& filter_options = checked_cast<const FilterNodeOptions&>(options);
55
56 auto filter_expression = filter_options.filter_expression;
57 if (!filter_expression.IsBound()) {
58 ARROW_ASSIGN_OR_RAISE(
59 filter_expression,
60 filter_expression.Bind(*schema, plan->query_context()->exec_context()));
61 }
62
63 if (filter_expression.type()->id() != Type::BOOL) {
64 return Status::TypeError("Filter expression must evaluate to bool, but ",
65 filter_expression.ToString(), " evaluates to ",
66 filter_expression.type()->ToString());
67 }
68 return plan->EmplaceNode<FilterNode>(plan, std::move(inputs), std::move(schema),
69 std::move(filter_expression));
70 }
71
72 const char* kind_name() const override { return "FilterNode"; }
73

Callers

nothing calls this directly

Calls 10

ValidateExecNodeInputsFunction · 0.85
IsBoundMethod · 0.80
exec_contextMethod · 0.80
query_contextMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.70
TypeErrorFunction · 0.50
BindMethod · 0.45
idMethod · 0.45
typeMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected