MCPcopy Create free account
hub / github.com/apache/arrow / CreateFor

Method CreateFor

cpp/src/arrow/builder.cc:204–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

is_unsigned_integerFunction · 0.70
is_integerFunction · 0.70
TypeErrorFunction · 0.70
OKFunction · 0.70
idMethod · 0.45
resetMethod · 0.45
byte_widthMethod · 0.45

Tested by

no test coverage detected