| 2301 | } |
| 2302 | |
| 2303 | void 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 | |
| 2351 | void BaseHashTable::prepareForJoinProbe( |
| 2352 | HashLookup& lookup, |
no test coverage detected