| 80 | |
| 81 | struct SliceIteratorFunctor { |
| 82 | Result<std::shared_ptr<RecordBatch>> Next() { |
| 83 | if (current_offset < batch->num_rows()) { |
| 84 | std::shared_ptr<RecordBatch> next = batch->Slice(current_offset, slice_size); |
| 85 | current_offset += slice_size; |
| 86 | return next; |
| 87 | } |
| 88 | return IterationTraits<std::shared_ptr<RecordBatch>>::End(); |
| 89 | } |
| 90 | const RecordBatch* const batch; |
| 91 | const int64_t slice_size; |
| 92 | int64_t current_offset; |