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

Function restoreSelectivityVector

bolt/vector/VectorSaver.cpp:780–794  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

778}
779
780SelectivityVector restoreSelectivityVector(std::istream& in) {
781 auto size = read<int32_t>(in);
782
783 const auto numBytes = bits::nbytes(size);
784
785 // SelectivityVector::setFromBits reads whole words (8 bytes). Make sure it is
786 // safe to access the "last" partially-populated word.
787 std::vector<char> bits(bits::roundUp(numBytes, 8));
788
789 in.read(bits.data(), numBytes);
790
791 SelectivityVector rows(size);
792 rows.setFromBits(reinterpret_cast<uint64_t*>(bits.data()), size);
793 return rows;
794}
795
796} // namespace bytedance::bolt
797

Callers 2

TEST_FFunction · 0.85

Calls 5

nbytesFunction · 0.85
roundUpFunction · 0.85
setFromBitsMethod · 0.80
readMethod · 0.45
dataMethod · 0.45

Tested by 2

TEST_FFunction · 0.68