| 98 | } |
| 99 | |
| 100 | int8_t BasicUnionBuilder::AppendChild(const std::shared_ptr<ArrayBuilder>& new_child, |
| 101 | const std::string& field_name) { |
| 102 | children_.push_back(new_child); |
| 103 | auto new_type_id = NextTypeId(); |
| 104 | |
| 105 | type_id_to_child_id_[new_type_id] = static_cast<int>(children_.size() - 1); |
| 106 | type_id_to_children_[new_type_id] = new_child.get(); |
| 107 | child_fields_.push_back(field(field_name, nullptr)); |
| 108 | type_codes_.push_back(static_cast<int8_t>(new_type_id)); |
| 109 | |
| 110 | return new_type_id; |
| 111 | } |
| 112 | |
| 113 | std::shared_ptr<DataType> BasicUnionBuilder::type() const { |
| 114 | std::vector<std::shared_ptr<Field>> child_fields(child_fields_.size()); |