| 66 | } |
| 67 | |
| 68 | std::unique_ptr<NodeDeleteExecutor> PlanMapper::getNodeDeleteExecutor( |
| 69 | const BoundDeleteInfo& boundInfo, const Schema& schema) const { |
| 70 | DASSERT(boundInfo.tableType == TableType::NODE); |
| 71 | auto& node = boundInfo.pattern->constCast<NodeExpression>(); |
| 72 | auto nodeIDPos = getDataPos(*node.getInternalID(), schema); |
| 73 | auto info = NodeDeleteInfo(boundInfo.deleteType, nodeIDPos); |
| 74 | if (node.isEmpty()) { |
| 75 | return std::make_unique<EmptyNodeDeleteExecutor>(std::move(info)); |
| 76 | } |
| 77 | if (node.isMultiLabeled()) { |
| 78 | table_id_map_t<NodeTableDeleteInfo> tableInfos; |
| 79 | for (auto entry : node.getEntries()) { |
| 80 | auto tableID = entry->getTableID(); |
| 81 | auto pkPos = getDataPos(*node.getPrimaryKey(tableID), schema); |
| 82 | tableInfos.insert({tableID, getNodeTableDeleteInfo(*entry, pkPos)}); |
| 83 | } |
| 84 | return std::make_unique<MultiLabelNodeDeleteExecutor>(std::move(info), |
| 85 | std::move(tableInfos)); |
| 86 | } |
| 87 | DASSERT(node.getNumEntries() == 1); |
| 88 | auto entry = node.getEntry(0); |
| 89 | auto pkPos = getDataPos(*node.getPrimaryKey(entry->getTableID()), schema); |
| 90 | auto extraInfo = getNodeTableDeleteInfo(*entry, pkPos); |
| 91 | return std::make_unique<SingleLabelNodeDeleteExecutor>(std::move(info), std::move(extraInfo)); |
| 92 | } |
| 93 | |
| 94 | std::unique_ptr<PhysicalOperator> PlanMapper::mapDelete(const LogicalOperator* logicalOperator) { |
| 95 | auto delete_ = logicalOperator->constPtrCast<LogicalDelete>(); |
nothing calls this directly
no test coverage detected