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

Function createPropertyExpression

src/binder/bind/bind_graph_pattern.cpp:135–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135static std::shared_ptr<PropertyExpression> createPropertyExpression(const std::string& propertyName,
136 const std::string& uniqueVariableName, const std::string& rawVariableName,
137 const std::vector<TableCatalogEntry*>& entries) {
138 table_id_map_t<SingleLabelPropertyInfo> infos;
139 std::vector<LogicalType> dataTypes;
140 for (auto& entry : entries) {
141 bool exists = false;
142 if (entry->containsProperty(propertyName)) {
143 exists = true;
144 dataTypes.push_back(entry->getProperty(propertyName).getType().copy());
145 }
146 // Bind isPrimaryKey
147 auto isPrimaryKey = false;
148 if (entry->getTableType() == TableType::NODE) {
149 auto nodeEntry = entry->constPtrCast<NodeTableCatalogEntry>();
150 isPrimaryKey = nodeEntry->getPrimaryKeyName() == propertyName;
151 }
152 auto info = SingleLabelPropertyInfo(exists, isPrimaryKey);
153 infos.insert({entry->getTableID(), std::move(info)});
154 }
155 LogicalType maxType = LogicalTypeUtils::combineTypes(dataTypes);
156 return std::make_shared<PropertyExpression>(std::move(maxType), propertyName,
157 uniqueVariableName, rawVariableName, std::move(infos));
158}
159
160static void checkRelDirectionTypeAgainstStorageDirection(const RelExpression* rel) {
161 switch (rel->getDirectionType()) {

Callers 5

transformSetMethod · 0.85
transformPropertyMethod · 0.85
createQueryNodeMethod · 0.85

Calls 7

containsPropertyMethod · 0.80
push_backMethod · 0.45
copyMethod · 0.45
getTypeMethod · 0.45
getTableTypeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected