| 45 | : pool_(pool), serde_(serde), options_(options) {} |
| 46 | |
| 47 | void serialize( |
| 48 | const RowVectorPtr& vector, |
| 49 | const folly::Range<const IndexRange*>& ranges, |
| 50 | Scratch& scratch, |
| 51 | OutputStream* stream) override { |
| 52 | size_t numRows = 0; |
| 53 | for (const auto& range : ranges) { |
| 54 | numRows += range.size; |
| 55 | } |
| 56 | |
| 57 | StreamArena arena(pool_); |
| 58 | auto serializer = serde_->createSerializer( |
| 59 | asRowType(vector->type()), numRows, &arena, options_); |
| 60 | serializer->append(vector, ranges, scratch); |
| 61 | serializer->flush(stream); |
| 62 | } |
| 63 | |
| 64 | private: |
| 65 | memory::MemoryPool* const pool_; |
nothing calls this directly
no test coverage detected