| 10 | namespace planner { |
| 11 | |
| 12 | LogicalPlan Planner::planQuery(const BoundStatement& boundStatement) { |
| 13 | auto& regularQuery = boundStatement.constCast<BoundRegularQuery>(); |
| 14 | if (regularQuery.getNumSingleQueries() == 1) { |
| 15 | return planSingleQuery(*regularQuery.getSingleQuery(0)); |
| 16 | } |
| 17 | std::vector<LogicalPlan> childrenPlans; |
| 18 | for (auto i = 0u; i < regularQuery.getNumSingleQueries(); i++) { |
| 19 | childrenPlans.push_back(planSingleQuery(*regularQuery.getSingleQuery(i))); |
| 20 | } |
| 21 | auto exprs = regularQuery.getStatementResult()->getColumns(); |
| 22 | return createUnionPlan(childrenPlans, exprs, regularQuery.getIsUnionAll(0)); |
| 23 | } |
| 24 | |
| 25 | LogicalPlan Planner::createUnionPlan(std::vector<LogicalPlan>& childrenPlans, |
| 26 | const expression_vector& expressions, bool isUnionAll) { |
nothing calls this directly
no test coverage detected