MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getNodeDeleteExecutor

Method getNodeDeleteExecutor

src/processor/map/map_delete.cpp:68–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::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
94std::unique_ptr<PhysicalOperator> PlanMapper::mapDelete(const LogicalOperator* logicalOperator) {
95 auto delete_ = logicalOperator->constPtrCast<LogicalDelete>();

Callers

nothing calls this directly

Calls 8

NodeDeleteInfoClass · 0.85
isMultiLabeledMethod · 0.80
getPrimaryKeyMethod · 0.80
isEmptyMethod · 0.45
getEntriesMethod · 0.45
insertMethod · 0.45
getNumEntriesMethod · 0.45
getEntryMethod · 0.45

Tested by

no test coverage detected