| 347 | } |
| 348 | |
| 349 | Status FileWriter::Write(RecordBatchReader* batches) { |
| 350 | while (true) { |
| 351 | ARROW_ASSIGN_OR_RAISE(auto batch, batches->Next()); |
| 352 | if (batch == nullptr) break; |
| 353 | RETURN_NOT_OK(Write(batch)); |
| 354 | } |
| 355 | return Status::OK(); |
| 356 | } |
| 357 | |
| 358 | Future<> FileWriter::Finish() { |
| 359 | return FinishInternal().Then([this]() -> Future<> { |