| 305 | } |
| 306 | |
| 307 | std::shared_ptr<DataType> StructBuilder::type() const { |
| 308 | DCHECK_EQ(type_->fields().size(), children_.size()); |
| 309 | std::vector<std::shared_ptr<Field>> fields(children_.size()); |
| 310 | for (int i = 0; i < static_cast<int>(fields.size()); ++i) { |
| 311 | fields[i] = type_->field(i)->WithType(children_[i]->type()); |
| 312 | } |
| 313 | return struct_(std::move(fields)); |
| 314 | } |
| 315 | |
| 316 | } // namespace arrow |