MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / mergeInto

Method mergeInto

src/processor/operator/aggregate/base_aggregate.cpp:81–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void BaseAggregateSharedState::HashTableQueue::mergeInto(AggregateHashTable& hashTable) {
82 TupleBlock* partitionToMerge = nullptr;
83 auto headBlock = this->headBlock.load();
84 DASSERT(headBlock != nullptr);
85 while (queuedTuples.pop(partitionToMerge)) {
86 DASSERT(
87 partitionToMerge->numTuplesWritten == partitionToMerge->table.getNumTuplesPerBlock());
88 hashTable.merge(std::move(partitionToMerge->table));
89 delete partitionToMerge;
90 }
91 if (headBlock->numTuplesWritten > 0) {
92 headBlock->table.resize(headBlock->numTuplesWritten);
93 hashTable.merge(std::move(headBlock->table));
94 }
95 delete headBlock;
96 this->headBlock = nullptr;
97}
98
99} // namespace processor
100} // namespace lbug

Callers 2

finalizePartitionsMethod · 0.80
finalizePartitionsMethod · 0.80

Calls 5

popMethod · 0.80
getNumTuplesPerBlockMethod · 0.80
loadMethod · 0.45
mergeMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected