| 570 | } |
| 571 | |
| 572 | Result<ExecNode*> Declaration::AddToPlan(ExecPlan* plan, |
| 573 | ExecFactoryRegistry* registry) const { |
| 574 | std::vector<ExecNode*> inputs(this->inputs.size()); |
| 575 | |
| 576 | size_t i = 0; |
| 577 | for (const Input& input : this->inputs) { |
| 578 | if (auto node = std::get_if<ExecNode*>(&input)) { |
| 579 | inputs[i++] = *node; |
| 580 | continue; |
| 581 | } |
| 582 | ARROW_ASSIGN_OR_RAISE(inputs[i++], |
| 583 | std::get<Declaration>(input).AddToPlan(plan, registry)); |
| 584 | } |
| 585 | |
| 586 | ARROW_ASSIGN_OR_RAISE( |
| 587 | auto node, MakeExecNode(this->factory_name, plan, std::move(inputs), *this->options, |
| 588 | registry)); |
| 589 | node->SetLabel(this->label); |
| 590 | return node; |
| 591 | } |
| 592 | |
| 593 | Declaration Declaration::Sequence(std::vector<Declaration> decls) { |
| 594 | DCHECK(!decls.empty()); |