| 227 | } |
| 228 | |
| 229 | void SortWindowBuild::noMoreInput() { |
| 230 | if (numRows_ == 0) { |
| 231 | return; |
| 232 | } |
| 233 | |
| 234 | if (sortSpiller_ != nullptr) { |
| 235 | finishLoadFromSpill_ = false; |
| 236 | return; |
| 237 | |
| 238 | } else { |
| 239 | // At this point we have seen all the input rows which are sorted. This will |
| 240 | // compute the index for each partition. |
| 241 | computePartitionStartRows(); |
| 242 | clearTopRows(); |
| 243 | } |
| 244 | } |
| 245 | |
| 246 | void SortWindowBuild::finish() { |
| 247 | for (int i = 0; i < allocatedSizes_.size(); i++) { |
| 248 | if (allocatedSizes_[i] == 0) { |
| 249 | continue; |
| 250 | } |
| 251 | data_->pool()->free(allocatedStarts_[i], allocatedSizes_[i]); |
| 252 | allocatedSizes_[i] = 0; |
| 253 | } |
| 254 | sortRows_.clear(); |
| 255 | allocatedStarts_.clear(); |
| 256 | allocatedSizes_.clear(); |
| 257 | numBuffers_.clear(); |
| 258 | data_->clear(); |
| 259 | data_->pool()->release(); |
| 260 | } |
| 261 |
nothing calls this directly
no test coverage detected