| 181 | |
| 182 | template <bool needSort> |
| 183 | char* RowsStreamingWindowBuild<needSort>::storeRows() { |
| 184 | BOLT_CHECK_GT(accumulatedLength_, 0); |
| 185 | BOLT_CHECK_NOT_NULL(info_); |
| 186 | char* newRows = nullptr; |
| 187 | newRows = |
| 188 | reinterpret_cast<char*>(data_->pool()->allocate(accumulatedLength_)); |
| 189 | int64_t offset = 0; |
| 190 | for (auto i = 0; i < tmpSortedRows_.size(); i++) { |
| 191 | auto dest = newRows + offset; |
| 192 | ContainerRow2RowSerde::copyRow( |
| 193 | dest, tmpSortedRows_[i], tmpSortedRowsSize_[i], *info_); |
| 194 | offset += tmpSortedRowsSize_[i]; |
| 195 | sortRows_.push_back(dest); |
| 196 | } |
| 197 | tmpSortedRows_.clear(); |
| 198 | tmpSortedRowsSize_.clear(); |
| 199 | return newRows; |
| 200 | } |
| 201 | |
| 202 | template <bool needSort> |
| 203 | void RowsStreamingWindowBuild<needSort>::loadNextPartitionFromSpill() { |