| 311 | } |
| 312 | |
| 313 | std::unique_ptr<UnorderedStreamReader<BatchStream>> |
| 314 | SpillPartition::createUnorderedReader( |
| 315 | memory::MemoryPool* pool, |
| 316 | bool spillUringEnabled, |
| 317 | bool isRowBased) { |
| 318 | BOLT_CHECK_NOT_NULL(pool); |
| 319 | std::vector<std::unique_ptr<BatchStream>> streams; |
| 320 | streams.reserve(files_.size()); |
| 321 | for (auto& fileInfo : files_) { |
| 322 | if (isRowBased) { |
| 323 | streams.push_back(RowBasedFileSpillBatchStream::create( |
| 324 | RowBasedSpillReadFile::create(fileInfo, pool, spillUringEnabled))); |
| 325 | } else { |
| 326 | streams.push_back(FileSpillBatchStream::create( |
| 327 | SpillReadFile::create(fileInfo, pool, spillUringEnabled))); |
| 328 | } |
| 329 | } |
| 330 | files_.clear(); |
| 331 | return std::make_unique<UnorderedStreamReader<BatchStream>>( |
| 332 | std::move(streams)); |
| 333 | } |
| 334 | |
| 335 | uint32_t FileSpillMergeStream::id() const { |
| 336 | BOLT_CHECK(!closed_); |