| 404 | |
| 405 | template <bool needSort> |
| 406 | void SpillableWindowBuild<needSort>::storeRows() { |
| 407 | BOLT_CHECK_GT(accumulatedLength_, 0); |
| 408 | BOLT_CHECK_NOT_NULL(info_); |
| 409 | char* newRows = nullptr; |
| 410 | newRows = |
| 411 | reinterpret_cast<char*>(data_->pool()->allocate(accumulatedLength_)); |
| 412 | allocatedStarts_.push_back(newRows); |
| 413 | allocatedSizes_.push_back(accumulatedLength_); |
| 414 | int64_t offset = 0; |
| 415 | char* dest = nullptr; |
| 416 | for (auto i = 0; i < tmpSortedRows_.size(); i++) { |
| 417 | dest = newRows + offset; |
| 418 | ContainerRow2RowSerde::copyRow( |
| 419 | dest, tmpSortedRows_[i], tmpSortedRowsSize_[i], *info_); |
| 420 | offset += tmpSortedRowsSize_[i]; |
| 421 | inputRows_.push_back(dest); |
| 422 | } |
| 423 | previousRow_ = dest; |
| 424 | lastRowSize_ = tmpSortedRowsSize_.back(); |
| 425 | tmpSortedRows_.clear(); |
| 426 | tmpSortedRowsSize_.clear(); |
| 427 | accumulatedLength_ = 0; |
| 428 | } |
| 429 | |
| 430 | template <bool needSort> |
| 431 | void SpillableWindowBuild<needSort>::loadNextPartitionFromSpill() { |