| 202 | |
| 203 | template <typename ValueType> |
| 204 | Status CreateFor() { |
| 205 | using AdaptiveBuilderType = DictionaryBuilder<ValueType>; |
| 206 | using ExactBuilderType = |
| 207 | internal::DictionaryBuilderBase<TypeErasedIntBuilder, ValueType>; |
| 208 | const bool unsigned_index = is_unsigned_integer(index_type->id()); |
| 209 | if (dictionary != nullptr) { |
| 210 | out->reset(new AdaptiveBuilderType(dictionary, pool, kDefaultBufferAlignment, |
| 211 | ordered, unsigned_index)); |
| 212 | } else if (exact_index_type) { |
| 213 | if (!is_integer(index_type->id())) { |
| 214 | return Status::TypeError("MakeBuilder: invalid index type ", *index_type); |
| 215 | } |
| 216 | out->reset(new ExactBuilderType(index_type, value_type, pool, |
| 217 | kDefaultBufferAlignment, ordered)); |
| 218 | } else { |
| 219 | auto start_int_size = index_type->byte_width(); |
| 220 | out->reset(new AdaptiveBuilderType(start_int_size, value_type, pool, |
| 221 | kDefaultBufferAlignment, ordered, |
| 222 | unsigned_index)); |
| 223 | } |
| 224 | return Status::OK(); |
| 225 | } |
| 226 | |
| 227 | Status Make() { return VisitTypeInline(*value_type, this); } |
| 228 |
nothing calls this directly
no test coverage detected