| 386 | } |
| 387 | |
| 388 | Status Process(ExecBatch batch) override { |
| 389 | // This can happen if an error was received and the source hasn't yet stopped. Since |
| 390 | // we have already called consumer_->Finish we don't want to call consumer_->Consume |
| 391 | if (input_counter_.Completed()) { |
| 392 | return Status::OK(); |
| 393 | } |
| 394 | |
| 395 | ARROW_RETURN_NOT_OK(consumer_->Consume(std::move(batch))); |
| 396 | if (input_counter_.Increment()) { |
| 397 | Finish(); |
| 398 | } |
| 399 | |
| 400 | return Status::OK(); |
| 401 | } |
| 402 | |
| 403 | Status InputFinished(ExecNode* input, int total_batches) override { |
| 404 | if (input_counter_.SetTotal(total_batches)) { |