| 955 | } |
| 956 | |
| 957 | std::set<StorageID> QueryPlan::allocateLocalTable(ContextPtr context) |
| 958 | { |
| 959 | std::set<StorageID> res; |
| 960 | for (const auto & node : nodes) |
| 961 | { |
| 962 | if (node.step->getType() == IQueryPlanStep::Type::TableScan) |
| 963 | { |
| 964 | auto * table_scan = dynamic_cast<TableScanStep *>(node.step.get()); |
| 965 | /// have to get storage_id before allocate to get original storage_id |
| 966 | /// instead of storage_id in cloud |
| 967 | res.insert(table_scan->getStorageID()); |
| 968 | table_scan->allocate(context); |
| 969 | } |
| 970 | else if (node.step->getType() == IQueryPlanStep::Type::TableWrite) |
| 971 | { |
| 972 | auto write_step = dynamic_cast<TableWriteStep *>(node.step.get()); |
| 973 | write_step->allocate(context); |
| 974 | } |
| 975 | } |
| 976 | return res; |
| 977 | } |
| 978 | |
| 979 | PlanNodePtr QueryPlan::getPlanNodeById(PlanNodeId node_id) const |
| 980 | { |
no test coverage detected