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

Method setHashTable

bolt/exec/HashJoinBridge.cpp:55–98  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53}
54
55bool HashJoinBridge::setHashTable(
56 std::shared_ptr<BaseHashTable> table,
57 SpillPartitionSet spillPartitionSet,
58 bool hasNullKeys,
59 SpillOffsetToBitsSet offsetToJoinBits) {
60 BOLT_CHECK_NOT_NULL(table, "setHashTable called with null table");
61
62 auto spillPartitionIdSet = toSpillPartitionIdSet(spillPartitionSet);
63
64 bool hasSpillData;
65 std::vector<ContinuePromise> promises;
66 {
67 std::lock_guard<std::mutex> l(mutex_);
68 BOLT_CHECK(started_);
69 BOLT_CHECK(!buildResult_.has_value());
70 BOLT_CHECK(restoringSpillShards_.empty());
71
72 if (restoringSpillPartitionId_.has_value()) {
73 for (const auto& id : spillPartitionIdSet) {
74 BOLT_DCHECK_LT(
75 restoringSpillPartitionId_->partitionBitOffset(),
76 id.partitionBitOffset());
77 }
78 }
79
80 for (auto& partitionEntry : spillPartitionSet) {
81 const auto id = partitionEntry.first;
82 BOLT_CHECK_EQ(spillPartitionSets_.count(id), 0);
83 spillPartitionSets_.emplace(id, std::move(partitionEntry.second));
84 }
85 buildResult_ = HashBuildResult(
86 std::move(table),
87 std::move(restoringSpillPartitionId_),
88 std::move(spillPartitionIdSet),
89 hasNullKeys,
90 offsetToJoinBits);
91 restoringSpillPartitionId_.reset();
92
93 hasSpillData = !spillPartitionSets_.empty();
94 promises = std::move(promises_);
95 }
96 notify(std::move(promises));
97 return hasSpillData;
98}
99
100void HashJoinBridge::setAntiJoinHasNullKeys() {
101 std::vector<ContinuePromise> promises;

Callers 3

setReusableHashTableMethod · 0.80
finishHashBuildMethod · 0.80
TEST_PFunction · 0.80

Calls 9

toSpillPartitionIdSetFunction · 0.85
HashBuildResultClass · 0.85
notifyFunction · 0.85
has_valueMethod · 0.80
partitionBitOffsetMethod · 0.80
emptyMethod · 0.45
countMethod · 0.45
emplaceMethod · 0.45
resetMethod · 0.45

Tested by 1

TEST_PFunction · 0.64