Note: we cannot append ResultCollector for plans enumerated for single query before there could be a UNION on top which requires further flatten. So we delay ResultCollector appending to enumerate regular query level.
| 11 | // be a UNION on top which requires further flatten. So we delay ResultCollector appending to |
| 12 | // enumerate regular query level. |
| 13 | LogicalPlan Planner::planSingleQuery(const NormalizedSingleQuery& singleQuery) { |
| 14 | auto propertyCollector = PropertyCollector(); |
| 15 | propertyCollector.visitSingleQuery(singleQuery); |
| 16 | auto properties = propertyCollector.getProperties(); |
| 17 | for (auto& expr : propertyCollector.getProperties()) { |
| 18 | auto& property = expr->constCast<PropertyExpression>(); |
| 19 | propertyExprCollection.addProperties(property.getVariableName(), expr); |
| 20 | } |
| 21 | context.resetState(); |
| 22 | auto plan = LogicalPlan(); |
| 23 | for (auto i = 0u; i < singleQuery.getNumQueryParts(); ++i) { |
| 24 | planQueryPart(*singleQuery.getQueryPart(i), plan); |
| 25 | } |
| 26 | return plan; |
| 27 | } |
| 28 | |
| 29 | void Planner::planQueryPart(const NormalizedQueryPart& queryPart, LogicalPlan& plan) { |
| 30 | // plan read |
nothing calls this directly
no test coverage detected