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

Method getNextTuplesInternal

src/processor/operator/cross_product.cpp:15–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13}
14
15bool CrossProduct::getNextTuplesInternal(ExecutionContext* context) {
16 // Note: we should NOT morselize right table scanning (i.e. calling sharedState.getMorsel)
17 // because every thread should scan its own table.
18 auto table = localState.table.get();
19 if (table->getNumTuples() == 0) {
20 return false;
21 }
22 if (localState.startIdx == table->getNumTuples()) { // no more to scan from right
23 if (!children[0]->getNextTuple(context)) { // fetch a new left tuple
24 return false;
25 }
26 localState.startIdx = 0; // reset right table scanning for a new left tuple
27 }
28 // scan from right table if there is tuple left
29 auto numTuplesToScan =
30 std::min(localState.maxMorselSize, table->getNumTuples() - localState.startIdx);
31 table->scan(vectorsToScan, localState.startIdx, numTuplesToScan, info.colIndicesToScan);
32 localState.startIdx += numTuplesToScan;
33 metrics->numOutputTuple.increase(numTuplesToScan);
34 return true;
35}
36
37} // namespace processor
38} // namespace lbug

Callers

nothing calls this directly

Calls 5

getNextTupleMethod · 0.80
getMethod · 0.45
getNumTuplesMethod · 0.45
scanMethod · 0.45
increaseMethod · 0.45

Tested by

no test coverage detected