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

Method dictionaryWrapping

bolt/vector/DecodedVector.cpp:392–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

390} // namespace
391
392DecodedVector::DictionaryWrapping DecodedVector::dictionaryWrapping(
393 const BaseVector& wrapper,
394 vector_size_t size) const {
395 BOLT_CHECK(!isIdentityMapping_);
396 BOLT_CHECK(!isConstantMapping_);
397 BOLT_CHECK_LE(size, size_);
398
399 // Make a copy of the indices and nulls buffers.
400 BufferPtr indices = copyIndicesBuffer(indices_, size, wrapper.pool());
401 // Only copy nulls if we have nulls coming from one of the wrappers, don't
402 // do it if nulls are missing or from the base vector.
403 // TODO: remove the check for hasExtraNulls_ after #3553 is merged.
404 BufferPtr nulls =
405 hasExtraNulls_ ? copyNullsBuffer(nulls_, size, wrapper.pool()) : nullptr;
406 return {std::move(indices), std::move(nulls)};
407}
408
409VectorPtr DecodedVector::wrap(
410 VectorPtr data,

Callers 2

TEST_FFunction · 0.45
setDictionaryWrappingMethod · 0.45

Calls 3

copyIndicesBufferFunction · 0.85
copyNullsBufferFunction · 0.85
poolMethod · 0.45

Tested by 1

TEST_FFunction · 0.36