| 109 | } |
| 110 | |
| 111 | std::unique_ptr<RelSetExecutor> PlanMapper::getRelSetExecutor(const BoundSetPropertyInfo& boundInfo, |
| 112 | const Schema& schema) const { |
| 113 | auto& rel = boundInfo.pattern->constCast<RelExpression>(); |
| 114 | auto srcNodeIDPos = getDataPos(*rel.getSrcNode()->getInternalID(), schema); |
| 115 | auto dstNodeIDPos = getDataPos(*rel.getDstNode()->getInternalID(), schema); |
| 116 | auto relIDPos = getDataPos(*rel.getInternalID(), schema); |
| 117 | auto& property = boundInfo.column->constCast<PropertyExpression>(); |
| 118 | auto columnVectorPos = DataPos::getInvalidPos(); |
| 119 | if (schema.isExpressionInScope(property)) { |
| 120 | columnVectorPos = getDataPos(property, schema); |
| 121 | } |
| 122 | auto exprMapper = ExpressionMapper(&schema); |
| 123 | auto evaluator = exprMapper.getEvaluator(boundInfo.columnData); |
| 124 | auto info = |
| 125 | RelSetInfo(srcNodeIDPos, dstNodeIDPos, relIDPos, columnVectorPos, std::move(evaluator)); |
| 126 | if (rel.isMultiLabeled()) { |
| 127 | table_id_map_t<RelTableSetInfo> tableInfos; |
| 128 | for (auto entry : rel.getEntries()) { |
| 129 | auto& relGroupEntry = entry->constCast<RelGroupCatalogEntry>(); |
| 130 | for (auto& relEntryInfo : relGroupEntry.getRelEntryInfos()) { |
| 131 | auto srcTableID = relEntryInfo.nodePair.srcTableID; |
| 132 | auto dstTableID = relEntryInfo.nodePair.dstTableID; |
| 133 | auto tableInfo = getRelTableSetInfo(relGroupEntry, srcTableID, dstTableID, property, |
| 134 | StorageManager::Get(*clientContext)); |
| 135 | if (tableInfo.columnID == INVALID_COLUMN_ID) { |
| 136 | continue; |
| 137 | } |
| 138 | tableInfos.insert({tableInfo.table->getTableID(), std::move(tableInfo)}); |
| 139 | } |
| 140 | } |
| 141 | return std::make_unique<MultiLabelRelSetExecutor>(std::move(info), std::move(tableInfos)); |
| 142 | } |
| 143 | DASSERT(rel.getNumEntries() == 1); |
| 144 | auto& relGroupEntry = rel.getEntry(0)->constCast<RelGroupCatalogEntry>(); |
| 145 | auto fromToNodePair = relGroupEntry.getSingleRelEntryInfo().nodePair; |
| 146 | auto tableInfo = getRelTableSetInfo(relGroupEntry, fromToNodePair.srcTableID, |
| 147 | fromToNodePair.dstTableID, property, StorageManager::Get(*clientContext)); |
| 148 | return std::make_unique<SingleLabelRelSetExecutor>(std::move(info), std::move(tableInfo)); |
| 149 | } |
| 150 | |
| 151 | std::unique_ptr<PhysicalOperator> PlanMapper::mapSetRelProperty( |
| 152 | const LogicalOperator* logicalOperator) { |
nothing calls this directly
no test coverage detected