| 407 | } |
| 408 | |
| 409 | VectorPtr 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 | |
| 433 | const uint64_t* DecodedVector::nulls(const SelectivityVector* rows) { |
| 434 | if (allNulls_.has_value()) { |