[[arrow::export]]
| 66 | |
| 67 | // [[arrow::export]] |
| 68 | std::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]] |
| 85 | std::shared_ptr<compute::Expression> compute___expr__field_ref(std::string name) { |
no test coverage detected