| 187 | } |
| 188 | |
| 189 | static Result<ExecNode*> Make(ExecPlan* plan, std::vector<ExecNode*> inputs, |
| 190 | const ExecNodeOptions& options) { |
| 191 | RETURN_NOT_OK(ValidateExecNodeInputs(plan, inputs, 1, "PivotLongerNode")); |
| 192 | |
| 193 | const auto& pivot_options = checked_cast<const PivotLongerNodeOptions&>(options); |
| 194 | |
| 195 | std::vector<BoundRowTemplate> templates; |
| 196 | for (const auto& row_template : pivot_options.row_templates) { |
| 197 | ARROW_ASSIGN_OR_RAISE( |
| 198 | BoundRowTemplate bound_template, |
| 199 | BoundRowTemplate::Make(row_template, *inputs[0]->output_schema())); |
| 200 | templates.push_back(std::move(bound_template)); |
| 201 | } |
| 202 | |
| 203 | ARROW_ASSIGN_OR_RAISE( |
| 204 | std::shared_ptr<Schema> output_schema, |
| 205 | PivotLongerNode::MakeOutputSchema(pivot_options, inputs[0]->output_schema())); |
| 206 | return plan->EmplaceNode<PivotLongerNode>(plan, std::move(inputs), |
| 207 | std::move(output_schema), pivot_options, |
| 208 | std::move(templates)); |
| 209 | } |
| 210 | |
| 211 | const char* kind_name() const override { return "PivotLongerNode"; } |
| 212 |
nothing calls this directly
no test coverage detected