| 195 | } |
| 196 | |
| 197 | bool RelTableData::checkIfNodeHasRels(Transaction* transaction, |
| 198 | ValueVector* srcNodeIDVector) const { |
| 199 | DASSERT(srcNodeIDVector->state->isFlat()); |
| 200 | const auto nodeIDPos = srcNodeIDVector->state->getSelVector()[0]; |
| 201 | const auto nodeOffset = srcNodeIDVector->getValue<nodeID_t>(nodeIDPos).offset; |
| 202 | const auto nodeGroupIdx = StorageUtils::getNodeGroupIdx(nodeOffset); |
| 203 | if (nodeGroupIdx >= getNumNodeGroups()) { |
| 204 | return false; |
| 205 | } |
| 206 | DataChunk scanChunk(1); |
| 207 | // RelID output vector. |
| 208 | scanChunk.insert(0, std::make_shared<ValueVector>(LogicalType::INTERNAL_ID())); |
| 209 | std::vector columnIDs = {REL_ID_COLUMN_ID}; |
| 210 | std::vector<const Column*> columns{getColumn(REL_ID_COLUMN_ID)}; |
| 211 | auto scanState = std::make_unique<RelTableScanState>(*mm, srcNodeIDVector, |
| 212 | std::vector{&scanChunk.getValueVectorMutable(0)}, scanChunk.state, true /*randomLookup*/); |
| 213 | scanState->setToTable(transaction, &table, columnIDs, {}, direction); |
| 214 | scanState->initState(transaction, getNodeGroup(nodeGroupIdx)); |
| 215 | while (true) { |
| 216 | const auto scanResult = scanState->nodeGroup->scan(transaction, *scanState); |
| 217 | if (scanResult == NODE_GROUP_SCAN_EMPTY_RESULT) { |
| 218 | break; |
| 219 | } |
| 220 | if (scanState->outState->getSelVector().getSelSize() > 0) { |
| 221 | return true; |
| 222 | } |
| 223 | } |
| 224 | return false; |
| 225 | } |
| 226 | |
| 227 | // NOLINTNEXTLINE(readability-make-member-function-const): Semantically non-const. |
| 228 | void RelTableData::pushInsertInfo(const Transaction* transaction, const CSRNodeGroup& nodeGroup, |
nothing calls this directly
no test coverage detected