| 254 | } |
| 255 | |
| 256 | static std::vector<RowVectorPtr> getOutputFromSpillMerger( |
| 257 | SpillMerger* spillMerger) { |
| 258 | std::vector<ContinueFuture> sourceBlockingFutures; |
| 259 | std::vector<RowVectorPtr> results; |
| 260 | for (;;) { |
| 261 | bool atEnd = false; |
| 262 | auto output = spillMerger->getOutput(sourceBlockingFutures, atEnd); |
| 263 | if (output != nullptr) { |
| 264 | results.emplace_back(std::move(output)); |
| 265 | } |
| 266 | |
| 267 | if (atEnd) { |
| 268 | break; |
| 269 | } |
| 270 | |
| 271 | while (!sourceBlockingFutures.empty()) { |
| 272 | auto future = std::move(sourceBlockingFutures.back()); |
| 273 | sourceBlockingFutures.pop_back(); |
| 274 | future.wait(); |
| 275 | } |
| 276 | } |
| 277 | return results; |
| 278 | } |
| 279 | |
| 280 | static void checkResults( |
| 281 | std::vector<RowVectorPtr> expectedResults, |