| 133 | } |
| 134 | |
| 135 | static 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 | |
| 160 | static void checkRelDirectionTypeAgainstStorageDirection(const RelExpression* rel) { |
| 161 | switch (rel->getDirectionType()) { |
no test coverage detected