| 390 | } // namespace |
| 391 | |
| 392 | DecodedVector::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 | |
| 409 | VectorPtr DecodedVector::wrap( |
| 410 | VectorPtr data, |