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

Method wrap

bolt/vector/DecodedVector.cpp:409–431  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

407}
408
409VectorPtr DecodedVector::wrap(
410 VectorPtr data,
411 const BaseVector& wrapper,
412 vector_size_t size) {
413 if (isConstantMapping_) {
414 if (isNullAt(0)) {
415 return BaseVector::createNullConstant(data->type(), size, data->pool());
416 } else if (data->isConstantEncoding() && size == data->size()) {
417 // Return `data` as is if it is constant encoded and the vector size
418 // matches exactly with the selection size. Otherwise, the constant vector
419 // will need to be resized to match it.
420 return data;
421 }
422 return BaseVector::wrapInConstant(size, constantIndex_, data);
423 }
424
425 auto wrapping = dictionaryWrapping(wrapper, size);
426 return BaseVector::wrapInDictionary(
427 std::move(wrapping.nulls),
428 std::move(wrapping.indices),
429 size,
430 std::move(data));
431}
432
433const uint64_t* DecodedVector::nulls(const SelectivityVector* rows) {
434 if (allNulls_.has_value()) {

Callers 5

TEST_FFunction · 0.45
AsJsonMethod · 0.45
applyMethod · 0.45
evalSpecialFormMethod · 0.45
evalSpecialFormMethod · 0.45

Calls 5

wrapInDictionaryFunction · 0.85
isNullAtFunction · 0.70
typeMethod · 0.45
poolMethod · 0.45
sizeMethod · 0.45

Tested by 1

TEST_FFunction · 0.36