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

Method nulls

bolt/vector/DecodedVector.cpp:433–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433const uint64_t* DecodedVector::nulls(const SelectivityVector* rows) {
434 if (allNulls_.has_value()) {
435 return allNulls_.value();
436 }
437
438 if (hasExtraNulls_) {
439 allNulls_ = nulls_;
440 } else if (!nulls_ || size_ == 0) {
441 allNulls_ = nullptr;
442 } else {
443 if (isIdentityMapping_) {
444 allNulls_ = nulls_;
445 } else if (isConstantMapping_) {
446 copiedNulls_.resize(0);
447 copiedNulls_.resize(bits::nwords(size_), bits::kNull64);
448 allNulls_ = copiedNulls_.data();
449 } else {
450 // Copy base nulls.
451 copiedNulls_.resize(bits::nwords(size_));
452 auto* rawCopiedNulls = copiedNulls_.data();
453 if (rows != nullptr) {
454 // Partial consistency check: The end may be less than the decode time
455 // end but not greater.
456 BOLT_CHECK_LE(rows->end(), size_);
457 }
458 auto baseSize = baseVector_->size();
459 applyToRows(rows, [&](auto i) {
460 BOLT_DCHECK_LT(indices_[i], baseSize);
461 bits::setNull(rawCopiedNulls, i, bits::isBitNull(nulls_, indices_[i]));
462 });
463 allNulls_ = copiedNulls_.data();
464 }
465 }
466
467 return allNulls_.value();
468}
469
470template <typename Func>
471void DecodedVector::applyToRows(const SelectivityVector* rows, Func&& func)

Callers 15

copyValuesAndNullsMethod · 0.45
copyMethod · 0.45
writeFlatVectorFunction · 0.45
writeDictionaryVectorFunction · 0.45
writeRowVectorFunction · 0.45
writeArrayVectorFunction · 0.45
writeMapVectorFunction · 0.45
printSizeAndNullCountFunction · 0.45
exportValidityBitmapFunction · 0.45
exportDictionaryFunction · 0.45
exportConstantValueFunction · 0.45
TEST_FFunction · 0.45

Calls 9

nwordsFunction · 0.85
isBitNullFunction · 0.85
has_valueMethod · 0.80
setNullFunction · 0.70
valueMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by 15

TEST_FFunction · 0.36
assertNoNullsMethod · 0.36
assertNullsMethod · 0.36
testConstantMethod · 0.36
testConstantNullMethod · 0.36
TEST_FFunction · 0.36
basicTestMethod · 0.36
createRowMethod · 0.36
testFlatMethod · 0.36
testCopyEncodedMethod · 0.36
TEST_FFunction · 0.36