| 80 | } |
| 81 | |
| 82 | Status ScanV2Options::AddFieldsNeededForFilter(ScanV2Options* options) { |
| 83 | std::vector<FieldRef> fields_referenced = FieldsInExpression(options->filter); |
| 84 | for (const auto& field : fields_referenced) { |
| 85 | // Note: this will fail if the field reference is ambiguous or the field doesn't |
| 86 | // exist in the dataset schema |
| 87 | ARROW_ASSIGN_OR_RAISE(auto field_path, field.FindOne(*options->dataset->schema())); |
| 88 | if (std::find(options->columns.begin(), options->columns.end(), field_path) == |
| 89 | options->columns.end()) { |
| 90 | options->columns.push_back(std::move(field_path)); |
| 91 | } |
| 92 | } |
| 93 | return Status::OK(); |
| 94 | } |
| 95 | |
| 96 | namespace { |
| 97 | class ScannerRecordBatchReader : public RecordBatchReader { |
nothing calls this directly
no test coverage detected