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

Function BindImpl

cpp/src/arrow/compute/expression.cc:606–632  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

604
605template <typename TypeOrSchema>
606Result<Expression> BindImpl(Expression expr, const TypeOrSchema& in,
607 compute::ExecContext* exec_context) {
608 if (exec_context == nullptr) {
609 compute::ExecContext exec_context;
610 return BindImpl(std::move(expr), in, &exec_context);
611 }
612
613 if (expr.literal()) return expr;
614
615 if (const FieldRef* ref = expr.field_ref()) {
616 ARROW_ASSIGN_OR_RAISE(FieldPath path, ref->FindOne(in));
617
618 Expression::Parameter param = *expr.parameter();
619 param.indices.resize(path.indices().size());
620 std::copy(path.indices().begin(), path.indices().end(), param.indices.begin());
621 ARROW_ASSIGN_OR_RAISE(auto field, path.Get(in));
622 param.type = field->type();
623 return Expression{std::move(param)};
624 }
625
626 auto call = *CallNotNull(expr);
627 for (auto& argument : call.arguments) {
628 ARROW_ASSIGN_OR_RAISE(argument, BindImpl(std::move(argument), in, exec_context));
629 }
630 return BindNonRecursive(std::move(call),
631 /*insert_implicit_casts=*/true, exec_context);
632}
633
634} // namespace
635

Callers 1

BindMethod · 0.85

Calls 12

CallNotNullFunction · 0.85
BindNonRecursiveFunction · 0.85
literalMethod · 0.80
field_refMethod · 0.80
resizeMethod · 0.80
indicesMethod · 0.80
ARROW_ASSIGN_OR_RAISEFunction · 0.50
parameterMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
typeMethod · 0.45

Tested by

no test coverage detected