| 289 | } |
| 290 | |
| 291 | void PathPropertyProbe::probe(lbug::processor::JoinHashTable* hashTable, uint64_t sizeProbed, |
| 292 | uint64_t sizeToProbe, ValueVector* idVector, const std::vector<ValueVector*>& propertyVectors, |
| 293 | const std::vector<ft_col_idx_t>& colIndicesToScan, const char* pathElementType) const { |
| 294 | // Hash |
| 295 | for (auto i = 0u; i < sizeToProbe; ++i) { |
| 296 | function::Hash::operation(idVector->getValue<internalID_t>(sizeProbed + i), |
| 297 | localState.hashes[i]); |
| 298 | } |
| 299 | // Probe hash |
| 300 | for (auto i = 0u; i < sizeToProbe; ++i) { |
| 301 | localState.probedTuples[i] = hashTable->getTupleForHash(localState.hashes[i]); |
| 302 | } |
| 303 | // Match value |
| 304 | for (auto i = 0u; i < sizeToProbe; ++i) { |
| 305 | localState.matchedTuples[i] = nullptr; |
| 306 | auto id = idVector->getValue<internalID_t>(sizeProbed + i); |
| 307 | while (localState.probedTuples[i]) { |
| 308 | auto currentTuple = localState.probedTuples[i]; |
| 309 | if (*(internalID_t*)currentTuple == id) { |
| 310 | localState.matchedTuples[i] = currentTuple; |
| 311 | break; |
| 312 | } |
| 313 | localState.probedTuples[i] = *hashTable->getPrevTuple(currentTuple); |
| 314 | } |
| 315 | if (localState.matchedTuples[i] == nullptr) { |
| 316 | throw RuntimeException(std::format( |
| 317 | "PathPropertyProbe failed to find {} property tuple for path element id " |
| 318 | "{{tableID: {}, offset: {}}}. This indicates the {} property hash table is " |
| 319 | "missing an ID produced by recursive path enumeration. hashTableEntries={}, " |
| 320 | "pathDataOffset={}, probeBatchOffset={}.", |
| 321 | pathElementType, id.tableID, id.offset, pathElementType, hashTable->getNumEntries(), |
| 322 | sizeProbed + i, i)); |
| 323 | } |
| 324 | } |
| 325 | // Scan table |
| 326 | auto factorizedTable = hashTable->getFactorizedTable(); |
| 327 | for (auto i = 0u; i < sizeToProbe; ++i) { |
| 328 | auto tuple = localState.matchedTuples[i]; |
| 329 | for (auto j = 0u; j < propertyVectors.size(); ++j) { |
| 330 | auto propertyVector = propertyVectors[j]; |
| 331 | auto colIdx = colIndicesToScan[j]; |
| 332 | factorizedTable->readFlatColToFlatVector(tuple, colIdx, *propertyVector, |
| 333 | sizeProbed + i); |
| 334 | } |
| 335 | } |
| 336 | } |
| 337 | |
| 338 | } // namespace processor |
| 339 | } // namespace lbug |
nothing calls this directly
no test coverage detected