| 557 | } |
| 558 | |
| 559 | void testListNullKeyRows( |
| 560 | const VectorPtr& keys, |
| 561 | BaseHashTable::HashMode mode) { |
| 562 | folly::F14FastSet<int> nullValues; |
| 563 | for (int i = 0; i < keys->size(); ++i) { |
| 564 | if (i % 97 == 0) { |
| 565 | keys->setNull(i, true); |
| 566 | nullValues.insert(i); |
| 567 | } |
| 568 | } |
| 569 | auto batch = makeRowVector( |
| 570 | {keys, makeFlatVector<int64_t>(keys->size(), folly::identity)}); |
| 571 | std::vector<std::unique_ptr<VectorHasher>> hashers; |
| 572 | hashers.push_back(std::make_unique<VectorHasher>(keys->type(), 0)); |
| 573 | auto table = HashTable<false>::createForJoin( |
| 574 | std::move(hashers), |
| 575 | {BIGINT()}, |
| 576 | true, |
| 577 | false, |
| 578 | BaseHashTable::HashMode::kArray, |
| 579 | 1'000, |
| 580 | pool(), |
| 581 | GetParam().jitRowEqVectors); |
| 582 | copyVectorsToTable({batch}, 0, table.get()); |
| 583 | table->prepareJoinTable({}, executor_.get()); |
| 584 | ASSERT_EQ(table->hashMode(), mode); |
| 585 | std::vector<char*> rows(nullValues.size()); |
| 586 | BaseHashTable::NullKeyRowsIterator iter; |
| 587 | auto numRows = table->listNullKeyRows(&iter, rows.size(), rows.data()); |
| 588 | ASSERT_EQ(numRows, nullValues.size()); |
| 589 | auto actual = |
| 590 | BaseVector::create<FlatVector<int64_t>>(BIGINT(), numRows, pool()); |
| 591 | table->rows()->extractColumn(rows.data(), numRows, 1, actual); |
| 592 | for (int i = 0; i < actual->size(); ++i) { |
| 593 | auto it = nullValues.find(actual->valueAt(i)); |
| 594 | ASSERT_TRUE(it != nullValues.end()); |
| 595 | nullValues.erase(it); |
| 596 | } |
| 597 | ASSERT_TRUE(nullValues.empty()); |
| 598 | ASSERT_EQ(0, table->listNullKeyRows(&iter, rows.size(), rows.data())); |
| 599 | } |
| 600 | |
| 601 | // Bitmap of positions in batches_ that end up in the table. |
| 602 | std::vector<uint64_t> isInTable_; |
nothing calls this directly
no test coverage detected