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

Function ConstantArray

cpp/src/arrow/testing/generator.cc:50–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48template <typename ArrowType, typename CType = typename TypeTraits<ArrowType>::CType,
49 typename BuilderType = typename TypeTraits<ArrowType>::BuilderType>
50static inline std::shared_ptr<Array> ConstantArray(int64_t size, CType value) {
51 auto type = TypeTraits<ArrowType>::type_singleton();
52 auto builder_fn = [&](BuilderType* builder) { builder->UnsafeAppend(value); };
53 return ArrayFromBuilderVisitor(type, size, builder_fn).ValueOrDie();
54}
55
56std::shared_ptr<arrow::Array> ConstantArrayGenerator::Boolean(int64_t size, bool value) {
57 return ConstantArray<BooleanType>(size, value);

Callers

nothing calls this directly

Calls 4

ArrayFromBuilderVisitorFunction · 0.85
ValueOrDieMethod · 0.80
type_singletonFunction · 0.50
UnsafeAppendMethod · 0.45

Tested by

no test coverage detected