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

Function compute___expr__field_names_in_expression

r/src/expression.cpp:68–82  ·  view source on GitHub ↗

[[arrow::export]]

Source from the content-addressed store, hash-verified

66
67// [[arrow::export]]
68std::vector<std::string> compute___expr__field_names_in_expression(
69 const std::shared_ptr<compute::Expression>& x) {
70 std::vector<std::string> names;
71 for (const auto& ref : compute::FieldsInExpression(*x)) {
72 if (ref.IsNested()) {
73 // Slight hack: this isn't the field's "name", but it's good enough
74 // for my current purposes. A nested field ref doesn't have a name property.
75 // Alternatively, we could skip nested refs like in get_field_ref_name
76 names.push_back(ref.ToString());
77 } else {
78 names.push_back(*ref.name());
79 }
80 }
81 return names;
82}
83
84// [[arrow::export]]
85std::shared_ptr<compute::Expression> compute___expr__field_ref(std::string name) {

Calls 4

FieldsInExpressionFunction · 0.85
push_backMethod · 0.80
ToStringMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected