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

Method hashValues

bolt/exec/VectorHasher.cpp:85–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83
84template <TypeKind Kind>
85FLATTEN void VectorHasher::hashValues(
86 const SelectivityVector& rows,
87 bool mix,
88 uint64_t* result) {
89 if (decoded_.isConstantMapping()) {
90 auto hash = decoded_.isNullAt(rows.begin())
91 ? kNullHash
92 : hashOne<Kind>(decoded_, rows.begin());
93 rows.applyToSelected([&](vector_size_t row) {
94 result[row] = mix ? bits::hashMix(result[row], hash) : hash;
95 });
96 } else if (decoded_.mayHaveNulls()) {
97 auto hashVec = result;
98 std::vector<uint64_t> hashVector(rows.end(), kNullHash);
99 if (mix) {
100 hashVec = hashVector.data();
101 } else {
102 rows.applyToSelected(
103 [&](vector_size_t row) { hashVec[row] = kNullHash; });
104 }
105 rows.applyToSelected(
106 [&](vector_size_t row) { hashVec[row] = hashOne<Kind>(decoded_, row); },
107 decoded_.nulls());
108 if (mix) {
109 rows.applyToSelected([&](vector_size_t row) {
110 result[row] = bits::hashMix(result[row], hashVec[row]);
111 });
112 }
113 } else {
114 rows.applyToSelected([&](vector_size_t row) {
115 auto hash = hashOne<Kind>(decoded_, row);
116 result[row] = mix ? bits::hashMix(result[row], hash) : hash;
117 });
118 }
119}
120
121template <TypeKind Kind>
122bool VectorHasher::makeValueIds(

Callers

nothing calls this directly

Calls 9

hashMixFunction · 0.85
isConstantMappingMethod · 0.80
applyToSelectedMethod · 0.80
isNullAtMethod · 0.45
beginMethod · 0.45
mayHaveNullsMethod · 0.45
endMethod · 0.45
dataMethod · 0.45
nullsMethod · 0.45

Tested by

no test coverage detected