| 152 | } |
| 153 | |
| 154 | Future<std::vector<ExecBatch>> StartAndCollect( |
| 155 | ExecPlan* plan, AsyncGenerator<std::optional<ExecBatch>> gen) { |
| 156 | RETURN_NOT_OK(plan->Validate()); |
| 157 | plan->StartProducing(); |
| 158 | |
| 159 | auto collected_fut = CollectAsyncGenerator(gen); |
| 160 | |
| 161 | return AllFinished({plan->finished(), Future<>(collected_fut)}) |
| 162 | .Then([collected_fut]() -> Result<std::vector<ExecBatch>> { |
| 163 | ARROW_ASSIGN_OR_RAISE(auto collected, collected_fut.result()); |
| 164 | return ::arrow::internal::MapVector( |
| 165 | [](std::optional<ExecBatch> batch) { return batch.value_or(ExecBatch()); }, |
| 166 | std::move(collected)); |
| 167 | }); |
| 168 | } |
| 169 | |
| 170 | namespace { |
| 171 |
no test coverage detected