QueryGraphCollection represents a pattern (a set of connected components) specified in MATCH clause.
| 143 | // QueryGraphCollection represents a pattern (a set of connected components) specified in MATCH |
| 144 | // clause. |
| 145 | class QueryGraphCollection { |
| 146 | public: |
| 147 | QueryGraphCollection() = default; |
| 148 | DELETE_COPY_DEFAULT_MOVE(QueryGraphCollection); |
| 149 | |
| 150 | void merge(const QueryGraphCollection& other); |
| 151 | void addAndMergeQueryGraphIfConnected(QueryGraph queryGraphToAdd); |
| 152 | void finalize(); |
| 153 | |
| 154 | common::idx_t getNumQueryGraphs() const { return queryGraphs.size(); } |
| 155 | QueryGraph* getQueryGraphUnsafe(common::idx_t idx) { return &queryGraphs[idx]; } |
| 156 | const QueryGraph* getQueryGraph(common::idx_t idx) const { return &queryGraphs[idx]; } |
| 157 | |
| 158 | bool contains(const std::string& name) const; |
| 159 | LBUG_API std::vector<std::shared_ptr<NodeExpression>> getQueryNodes() const; |
| 160 | LBUG_API std::vector<std::shared_ptr<RelExpression>> getQueryRels() const; |
| 161 | |
| 162 | private: |
| 163 | std::vector<QueryGraph> mergeGraphs(common::idx_t baseGraphIdx); |
| 164 | |
| 165 | private: |
| 166 | std::vector<QueryGraph> queryGraphs; |
| 167 | }; |
| 168 | |
| 169 | struct BoundGraphPattern { |
| 170 | QueryGraphCollection queryGraphCollection; |