| 294 | } |
| 295 | |
| 296 | Result<std::shared_ptr<UnionDataset>> UnionDataset::Make(std::shared_ptr<Schema> schema, |
| 297 | DatasetVector children) { |
| 298 | for (const auto& child : children) { |
| 299 | if (!child->schema()->Equals(*schema)) { |
| 300 | return Status::TypeError("child Dataset had schema ", *child->schema(), |
| 301 | " but the union schema was ", *schema); |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | return std::shared_ptr<UnionDataset>( |
| 306 | new UnionDataset(std::move(schema), std::move(children))); |
| 307 | } |
| 308 | |
| 309 | Result<std::shared_ptr<Dataset>> UnionDataset::ReplaceSchema( |
| 310 | std::shared_ptr<Schema> schema) const { |