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

Method getNextTuplesInternal

src/processor/operator/unwind.cpp:48–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48bool Unwind::getNextTuplesInternal(ExecutionContext* context) {
49 if (hasMoreToRead()) {
50 auto totalElementsCopy =
51 std::min(DEFAULT_VECTOR_CAPACITY, (uint64_t)listEntry.size - startIndex);
52 copyTuplesToOutVector(startIndex, (totalElementsCopy + startIndex));
53 startIndex += totalElementsCopy;
54 outValueVector->state->initOriginalAndSelectedSize(totalElementsCopy);
55 return true;
56 }
57 do {
58 if (!children[0]->getNextTuple(context)) {
59 return false;
60 }
61 expressionEvaluator->evaluate();
62 auto pos = expressionEvaluator->resultVector->state->getSelVector()[0];
63 if (expressionEvaluator->resultVector->isNull(pos)) {
64 outValueVector->state->getSelVectorUnsafe().setSelSize(0);
65 continue;
66 }
67 listEntry = expressionEvaluator->resultVector->getValue<list_entry_t>(pos);
68 startIndex = 0;
69 auto totalElementsCopy = std::min(DEFAULT_VECTOR_CAPACITY, (uint64_t)listEntry.size);
70 copyTuplesToOutVector(0, totalElementsCopy);
71 startIndex += totalElementsCopy;
72 outValueVector->state->initOriginalAndSelectedSize(startIndex);
73 } while (outValueVector->state->getSelVector().getSelSize() == 0);
74 metrics->numOutputTuple.increase(outValueVector->state->getSelVector().getSelSize());
75 return true;
76}
77
78} // namespace processor
79} // namespace lbug

Callers

nothing calls this directly

Calls 6

getNextTupleMethod · 0.80
setSelSizeMethod · 0.80
getSelSizeMethod · 0.80
evaluateMethod · 0.45
isNullMethod · 0.45
increaseMethod · 0.45

Tested by

no test coverage detected