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

Method prepareForGroupProbe

bolt/exec/HashTable.cpp:2303–2349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2301}
2302
2303void BaseHashTable::prepareForGroupProbe(
2304 HashLookup& lookup,
2305 const RowVectorPtr& input,
2306 SelectivityVector& rows,
2307 bool ignoreNullKeys,
2308 int8_t spillInputStartPartitionBit) {
2309 checkHashBitsOverlap(spillInputStartPartitionBit);
2310 auto& hashers = lookup.hashers;
2311
2312 for (auto& hasher : hashers) {
2313 auto key = input->childAt(hasher->channel())->loadedVector();
2314 hasher->decode(*key, rows);
2315 }
2316
2317 if (ignoreNullKeys) {
2318 // A null in any of the keys disables the row.
2319 deselectRowsWithNulls(hashers, rows);
2320 }
2321
2322 lookup.reset(rows.end());
2323
2324 bool rehash = false;
2325 const auto mode = hashMode();
2326 for (auto i = 0; i < hashers.size(); ++i) {
2327 auto& hasher = hashers[i];
2328 if (mode != BaseHashTable::HashMode::kHash) {
2329 if (!hasher->computeValueIds(rows, lookup.hashes)) {
2330 rehash = true;
2331 }
2332 } else {
2333 hasher->hash(rows, i > 0, lookup.hashes);
2334 }
2335 }
2336
2337 if (rehash || capacity() == 0) {
2338 if (mode != BaseHashTable::HashMode::kHash) {
2339 decideHashMode(input->size());
2340 // Do not forward 'ignoreNullKeys' to avoid redundant evaluation of
2341 // deselectRowsWithNulls.
2342 prepareForGroupProbe(
2343 lookup, input, rows, false, spillInputStartPartitionBit);
2344 return;
2345 }
2346 }
2347
2348 populateLookupRows(rows, lookup.rows);
2349}
2350
2351void BaseHashTable::prepareForJoinProbe(
2352 HashLookup& lookup,

Callers 7

addInputMethod · 0.80
addSpillInputMethod · 0.80
addInputForActiveRowsMethod · 0.80
addInputMethod · 0.80
addInputMethod · 0.80
addInputMethod · 0.80

Calls 12

deselectRowsWithNullsFunction · 0.85
capacityFunction · 0.85
populateLookupRowsFunction · 0.85
childAtMethod · 0.80
loadedVectorMethod · 0.45
channelMethod · 0.45
decodeMethod · 0.45
resetMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45
computeValueIdsMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected