\brief Append an element to the UnionArray. This must be followed by an append to the appropriate child builder. \param[in] next_type type_id of the child to which the next value will be appended. The corresponding child builder must be appended to independently after this method is called.
| 154 | /// The corresponding child builder must be appended to independently after this method |
| 155 | /// is called. |
| 156 | Status Append(int8_t next_type) { |
| 157 | ARROW_RETURN_NOT_OK(types_builder_.Append(next_type)); |
| 158 | if (type_id_to_children_[next_type]->length() == kListMaximumElements) { |
| 159 | return Status::CapacityError( |
| 160 | "a dense UnionArray cannot contain more than 2^31 - 1 elements from a single " |
| 161 | "child"); |
| 162 | } |
| 163 | auto offset = static_cast<int32_t>(type_id_to_children_[next_type]->length()); |
| 164 | return offsets_builder_.Append(offset); |
| 165 | } |
| 166 | |
| 167 | Status AppendArraySlice(const ArraySpan& array, int64_t offset, |
| 168 | int64_t length) override; |
no test coverage detected