| 241 | } |
| 242 | |
| 243 | void SpillWriter::closeFile() { |
| 244 | if (currentFile_ == nullptr) { |
| 245 | return; |
| 246 | } |
| 247 | currentFile_->finish(); |
| 248 | updateSpilledFileStats(currentFile_->size()); |
| 249 | finishedFiles_.push_back(SpillFileInfo{ |
| 250 | .id = currentFile_->id(), |
| 251 | .type = type_, |
| 252 | .path = currentFile_->path(), |
| 253 | .size = currentFile_->size(), |
| 254 | .rowCount = rowsInCurrentFile_, |
| 255 | .sortingKeys = sortingKeys_, |
| 256 | .compressionKind = compressionKind_, |
| 257 | .serdeKind = spillSerdeKind_, |
| 258 | .rowInfo = rowInfo_}); |
| 259 | rowsInCurrentFile_ = 0; |
| 260 | currentFile_.reset(); |
| 261 | } |
| 262 | |
| 263 | size_t SpillWriter::numFinishedFiles() const { |
| 264 | return finishedFiles_.size(); |