| 29 | namespace acero { |
| 30 | |
| 31 | Status ValidateExecNodeInputs(ExecPlan* plan, const std::vector<ExecNode*>& inputs, |
| 32 | int expected_num_inputs, const char* kind_name) { |
| 33 | if (static_cast<int>(inputs.size()) != expected_num_inputs) { |
| 34 | return Status::Invalid(kind_name, " requires ", expected_num_inputs, |
| 35 | " inputs but got ", inputs.size()); |
| 36 | } |
| 37 | |
| 38 | for (auto input : inputs) { |
| 39 | if (input->plan() != plan) { |
| 40 | return Status::Invalid("Constructing a ", kind_name, |
| 41 | " node in a different plan from its input"); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | return Status::OK(); |
| 46 | } |
| 47 | |
| 48 | Result<std::shared_ptr<Table>> TableFromExecBatches( |
| 49 | const std::shared_ptr<Schema>& schema, const std::vector<ExecBatch>& exec_batches) { |