| 13 | } |
| 14 | |
| 15 | bool 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 |
nothing calls this directly
no test coverage detected