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

Method executeInternal

src/processor/operator/partitioner.cpp:130–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void Partitioner::executeInternal(ExecutionContext* context) {
131 const auto relOffsetVector = resultSet->getValueVector(info.relOffsetDataPos);
132 while (children[0]->getNextTuple(context)) {
133 DASSERT(dataInfo.columnEvaluators.size() >= 1);
134 const auto numRels = relOffsetVector->state->getSelVector().getSelSize();
135 evaluateExpressions(numRels);
136 auto currentRelOffset = sharedState->relTable->reserveRelOffsets(numRels);
137 for (auto i = 0u; i < numRels; i++) {
138 const auto pos = relOffsetVector->state->getSelVector()[i];
139 relOffsetVector->setValue<offset_t>(pos, currentRelOffset++);
140 }
141 for (auto partitioningIdx = 0u; partitioningIdx < info.infos.size(); partitioningIdx++) {
142 auto& partitionInfo = info.infos[partitioningIdx];
143 auto keyVector = dataInfo.columnEvaluators[partitionInfo.keyIdx]->resultVector;
144 partitionIdxes->state = keyVector->state;
145 partitionInfo.partitionerFunc(keyVector.get(), partitionIdxes.get());
146 auto chunkToCopyFrom = constructDataChunk(keyVector->state);
147 copyDataToPartitions(*MemoryManager::Get(*context->clientContext), partitioningIdx,
148 chunkToCopyFrom);
149 }
150 }
151 sharedState->merge(localState->partitioningBuffers);
152}
153
154void Partitioner::evaluateExpressions(uint64_t numRels) const {
155 for (auto i = 0u; i < dataInfo.evaluateTypes.size(); ++i) {

Callers

nothing calls this directly

Calls 6

getNextTupleMethod · 0.80
getSelSizeMethod · 0.80
getValueVectorMethod · 0.45
sizeMethod · 0.45
getMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected