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

Function Visit

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

Source from the content-addressed store, hash-verified

1530 }
1531
1532 Status Visit(const Expression& expr) {
1533 if (auto lit = expr.literal()) {
1534 if (!lit->is_scalar()) {
1535 return Status::NotImplemented("Serialization of non-scalar literals");
1536 }
1537 ARROW_ASSIGN_OR_RAISE(auto value, AddScalar(*lit->scalar()));
1538 metadata_->Append("literal", std::move(value));
1539 return Status::OK();
1540 }
1541
1542 if (auto ref = expr.field_ref()) {
1543 return VisitFieldRef(*ref);
1544 }
1545
1546 auto call = CallNotNull(expr);
1547 metadata_->Append("call", call->function_name);
1548
1549 for (const auto& argument : call->arguments) {
1550 RETURN_NOT_OK(Visit(argument));
1551 }
1552
1553 if (call->options) {
1554 ARROW_ASSIGN_OR_RAISE(auto options_scalar,
1555 internal::FunctionOptionsToStructScalar(*call->options));
1556 ARROW_ASSIGN_OR_RAISE(auto value, AddScalar(*options_scalar));
1557 metadata_->Append("options", std::move(value));
1558 }
1559
1560 metadata_->Append("end", call->function_name);
1561 return Status::OK();
1562 }
1563
1564 Result<std::shared_ptr<RecordBatch>> operator()(const Expression& expr) {
1565 RETURN_NOT_OK(Visit(expr));

Callers 2

operator()Function · 0.70
AppendSelectedMethod · 0.70

Calls 8

VisitFieldRefFunction · 0.85
CallNotNullFunction · 0.85
literalMethod · 0.80
is_scalarMethod · 0.80
field_refMethod · 0.80
NotImplementedFunction · 0.50
OKFunction · 0.50
AppendMethod · 0.45

Tested by

no test coverage detected