| 2449 | } |
| 2450 | |
| 2451 | Result<std::shared_ptr<Schema>> Schema::WithNames( |
| 2452 | const std::vector<std::string>& names) const { |
| 2453 | if (names.size() != impl_->fields_.size()) { |
| 2454 | return Status::Invalid("attempted to rename schema with ", impl_->fields_.size(), |
| 2455 | " fields but only ", names.size(), " new names were given"); |
| 2456 | } |
| 2457 | FieldVector new_fields; |
| 2458 | new_fields.reserve(names.size()); |
| 2459 | auto names_itr = names.begin(); |
| 2460 | for (const auto& field : impl_->fields_) { |
| 2461 | new_fields.push_back(field->WithName(*names_itr++)); |
| 2462 | } |
| 2463 | return schema(std::move(new_fields)); |
| 2464 | } |
| 2465 | |
| 2466 | std::shared_ptr<Schema> Schema::WithMetadata( |
| 2467 | const std::shared_ptr<const KeyValueMetadata>& metadata) const { |
no test coverage detected