| 56 | } |
| 57 | |
| 58 | Result<std::shared_ptr<Schema>> Fragment::ReadPhysicalSchema() { |
| 59 | { |
| 60 | auto lock = physical_schema_mutex_.Lock(); |
| 61 | if (physical_schema_ != nullptr) return physical_schema_; |
| 62 | } |
| 63 | |
| 64 | // allow ReadPhysicalSchemaImpl to lock mutex_, if necessary |
| 65 | ARROW_ASSIGN_OR_RAISE(auto physical_schema, ReadPhysicalSchemaImpl()); |
| 66 | |
| 67 | auto lock = physical_schema_mutex_.Lock(); |
| 68 | if (physical_schema_ == nullptr) { |
| 69 | physical_schema_ = std::move(physical_schema); |
| 70 | } |
| 71 | return physical_schema_; |
| 72 | } |
| 73 | |
| 74 | Future<std::optional<int64_t>> Fragment::CountRows(compute::Expression, |
| 75 | const std::shared_ptr<ScanOptions>&) { |