MCPcopy Create free account
hub / github.com/bytedance/bolt / createEmpty

Function createEmpty

bolt/vector/BaseVector.cpp:283–304  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281
282template <TypeKind kind>
283static VectorPtr createEmpty(
284 vector_size_t size,
285 bolt::memory::MemoryPool* pool,
286 const TypePtr& type) {
287 using T = typename TypeTraits<kind>::NativeType;
288
289 BufferPtr values;
290 if constexpr (std::is_same_v<T, StringView>) {
291 // Make sure to initialize StringView values so they can be safely accessed.
292 values = AlignedBuffer::allocate<T>(size, pool, T());
293 } else {
294 values = AlignedBuffer::allocate<T>(size, pool);
295 }
296
297 return std::make_shared<FlatVector<T>>(
298 pool,
299 type,
300 BufferPtr(nullptr),
301 size,
302 std::move(values),
303 std::vector<BufferPtr>());
304}
305
306// static
307VectorPtr BaseVector::createInternal(

Callers 14

combineInputColumnsFunction · 0.85
TEST_FFunction · 0.85
projectColumnsMethod · 0.85
getOutputMethod · 0.85
wrapAndCombineDictFunction · 0.85
makeVectorsMethod · 0.85
makeBatchesFunction · 0.85
makeBatchesFunction · 0.85
HiveDataSourceClass · 0.85
nextMethod · 0.85
readWithPredicateMethod · 0.85

Calls

no outgoing calls

Tested by 7

TEST_FFunction · 0.68
makeVectorsMethod · 0.68
makeBatchesFunction · 0.68
makeBatchesFunction · 0.68
readWithPredicateMethod · 0.68
expectedByPredicateMethod · 0.68
validateReadMethod · 0.68