| 46 | } |
| 47 | |
| 48 | static std::unordered_set<table_id_t> getNbrNodeTableIDSet(const RelExpression& rel, |
| 49 | ExtendDirection extendDirection) { |
| 50 | std::unordered_set<table_id_t> result; |
| 51 | for (auto entry : rel.getEntries()) { |
| 52 | auto& groupEntry = entry->constCast<RelGroupCatalogEntry>(); |
| 53 | switch (extendDirection) { |
| 54 | case ExtendDirection::FWD: { |
| 55 | result.merge(groupEntry.getNbrNodeTableIDSet(RelDataDirection::FWD)); |
| 56 | } break; |
| 57 | case ExtendDirection::BWD: { |
| 58 | result.merge(groupEntry.getNbrNodeTableIDSet(RelDataDirection::BWD)); |
| 59 | } break; |
| 60 | case ExtendDirection::BOTH: { |
| 61 | result.merge(groupEntry.getNbrNodeTableIDSet(RelDataDirection::FWD)); |
| 62 | result.merge(groupEntry.getNbrNodeTableIDSet(RelDataDirection::BWD)); |
| 63 | } break; |
| 64 | default: |
| 65 | UNREACHABLE_CODE; |
| 66 | } |
| 67 | } |
| 68 | return result; |
| 69 | } |
| 70 | |
| 71 | void Planner::appendNonRecursiveExtend(const std::shared_ptr<NodeExpression>& boundNode, |
| 72 | const std::shared_ptr<NodeExpression>& nbrNode, const std::shared_ptr<RelExpression>& rel, |
no test coverage detected