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

Method getNodeSetExecutor

src/processor/map/map_set.cpp:46–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46std::unique_ptr<NodeSetExecutor> PlanMapper::getNodeSetExecutor(
47 const BoundSetPropertyInfo& boundInfo, const Schema& schema) const {
48 auto& node = boundInfo.pattern->constCast<NodeExpression>();
49 auto nodeIDPos = getDataPos(*node.getInternalID(), schema);
50 auto& property = boundInfo.column->constCast<PropertyExpression>();
51 auto columnVectorPos = DataPos::getInvalidPos();
52 if (schema.isExpressionInScope(property)) {
53 columnVectorPos = getDataPos(property, schema);
54 }
55 auto exprMapper = ExpressionMapper(&schema);
56 auto evaluator = exprMapper.getEvaluator(boundInfo.columnData);
57 auto setInfo = NodeSetInfo(nodeIDPos, columnVectorPos, std::move(evaluator));
58 if (node.isMultiLabeled()) {
59 table_id_map_t<NodeTableSetInfo> tableInfos;
60 for (auto entry : node.getEntries()) {
61 auto tableID = entry->getTableID();
62 auto tableInfo =
63 getNodeTableSetInfo(*entry, property, StorageManager::Get(*clientContext));
64 if (tableInfo.columnID == INVALID_COLUMN_ID) {
65 continue;
66 }
67 tableInfos.insert({tableID, std::move(tableInfo)});
68 }
69 return std::make_unique<MultiLabelNodeSetExecutor>(std::move(setInfo),
70 std::move(tableInfos));
71 }
72 DASSERT(node.getNumEntries() == 1);
73 auto tableInfo =
74 getNodeTableSetInfo(*node.getEntry(0), property, StorageManager::Get(*clientContext));
75 return std::make_unique<SingleLabelNodeSetExecutor>(std::move(setInfo), std::move(tableInfo));
76}
77
78std::unique_ptr<PhysicalOperator> PlanMapper::mapSetProperty(
79 const LogicalOperator* logicalOperator) {

Callers

nothing calls this directly

Calls 10

ExpressionMapperClass · 0.85
NodeSetInfoClass · 0.85
getNodeTableSetInfoFunction · 0.85
isExpressionInScopeMethod · 0.80
getEvaluatorMethod · 0.80
isMultiLabeledMethod · 0.80
getEntriesMethod · 0.45
insertMethod · 0.45
getNumEntriesMethod · 0.45
getEntryMethod · 0.45

Tested by

no test coverage detected