| 79 | } |
| 80 | |
| 81 | static std::vector<ScanRelTableInfo> populateRelTableCollectionScanner(table_id_t boundNodeTableID, |
| 82 | const table_id_set_t& nbrTableISet, const RelGroupCatalogEntry& entry, |
| 83 | ExtendDirection extendDirection, bool shouldScanNbrID, const expression_vector& properties, |
| 84 | const std::vector<ColumnPredicateSet>& columnPredicates, main::ClientContext* clientContext) { |
| 85 | std::vector<ScanRelTableInfo> scanInfos; |
| 86 | const auto storageManager = StorageManager::Get(*clientContext); |
| 87 | for (auto& info : entry.getRelEntryInfos()) { |
| 88 | auto srcTableID = info.nodePair.srcTableID; |
| 89 | auto dstTableID = info.nodePair.dstTableID; |
| 90 | auto relTable = storageManager->getTable(info.oid)->ptrCast<RelTable>(); |
| 91 | switch (extendDirection) { |
| 92 | case ExtendDirection::FWD: { |
| 93 | if (isRelTableQualifies(ExtendDirection::FWD, srcTableID, dstTableID, boundNodeTableID, |
| 94 | nbrTableISet)) { |
| 95 | scanInfos.push_back(getRelTableScanInfo(entry, RelDataDirection::FWD, relTable, |
| 96 | shouldScanNbrID, properties, columnPredicates, clientContext)); |
| 97 | } |
| 98 | } break; |
| 99 | case ExtendDirection::BWD: { |
| 100 | if (isRelTableQualifies(ExtendDirection::BWD, srcTableID, dstTableID, boundNodeTableID, |
| 101 | nbrTableISet)) { |
| 102 | scanInfos.push_back(getRelTableScanInfo(entry, RelDataDirection::BWD, relTable, |
| 103 | shouldScanNbrID, properties, columnPredicates, clientContext)); |
| 104 | } |
| 105 | } break; |
| 106 | case ExtendDirection::BOTH: { |
| 107 | if (isRelTableQualifies(ExtendDirection::FWD, srcTableID, dstTableID, boundNodeTableID, |
| 108 | nbrTableISet)) { |
| 109 | scanInfos.push_back(getRelTableScanInfo(entry, RelDataDirection::FWD, relTable, |
| 110 | shouldScanNbrID, properties, columnPredicates, clientContext)); |
| 111 | } |
| 112 | if (isRelTableQualifies(ExtendDirection::BWD, srcTableID, dstTableID, boundNodeTableID, |
| 113 | nbrTableISet)) { |
| 114 | scanInfos.push_back(getRelTableScanInfo(entry, RelDataDirection::BWD, relTable, |
| 115 | shouldScanNbrID, properties, columnPredicates, clientContext)); |
| 116 | } |
| 117 | } break; |
| 118 | default: |
| 119 | UNREACHABLE_CODE; |
| 120 | } |
| 121 | } |
| 122 | return scanInfos; |
| 123 | } |
| 124 | |
| 125 | static bool scanSingleRelTable(const RelExpression& rel, const NodeExpression& boundNode, |
| 126 | ExtendDirection extendDirection) { |
no test coverage detected