| 46 | } |
| 47 | |
| 48 | bool 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 |
nothing calls this directly
no test coverage detected