| 111 | } |
| 112 | |
| 113 | std::shared_ptr<DataType> BasicUnionBuilder::type() const { |
| 114 | std::vector<std::shared_ptr<Field>> child_fields(child_fields_.size()); |
| 115 | for (size_t i = 0; i < child_fields.size(); ++i) { |
| 116 | child_fields[i] = child_fields_[i]->WithType(children_[i]->type()); |
| 117 | } |
| 118 | return mode_ == UnionMode::SPARSE ? sparse_union(std::move(child_fields), type_codes_) |
| 119 | : dense_union(std::move(child_fields), type_codes_); |
| 120 | } |
| 121 | |
| 122 | int8_t BasicUnionBuilder::NextTypeId() { |
| 123 | // Find type_id such that type_id_to_children_[type_id] == nullptr |