| 651 | } |
| 652 | |
| 653 | void FactorizedTableIterator::getNext(FlatTuple& tuple) { |
| 654 | // Go to the next tuple if we have iterated all the flat tuples of the current tuple. |
| 655 | if (nextFlatTupleIdx >= numFlatTuples) { |
| 656 | currentTupleBuffer = factorizedTable.getTuple(nextTupleIdx); |
| 657 | numFlatTuples = factorizedTable.getNumFlatTuples(nextTupleIdx); |
| 658 | nextFlatTupleIdx = 0; |
| 659 | updateNumElementsInDataChunk(); |
| 660 | nextTupleIdx++; |
| 661 | } |
| 662 | for (auto i = 0ul; i < factorizedTable.getTableSchema()->getNumColumns(); i++) { |
| 663 | auto column = factorizedTable.getTableSchema()->getColumn(i); |
| 664 | if (column->isFlat()) { |
| 665 | readFlatColToFlatTuple(i, currentTupleBuffer, tuple); |
| 666 | } else { |
| 667 | readUnflatColToFlatTuple(i, currentTupleBuffer, tuple); |
| 668 | } |
| 669 | } |
| 670 | updateFlatTuplePositionsInDataChunk(); |
| 671 | nextFlatTupleIdx++; |
| 672 | } |
| 673 | |
| 674 | void FactorizedTableIterator::resetState() { |
| 675 | numFlatTuples = 0; |