| 363 | } |
| 364 | |
| 365 | void HashJoinSIPOptimizer::visitPathPropertyProbe(LogicalOperator* op) { |
| 366 | auto& pathPropertyProbe = op->cast<LogicalPathPropertyProbe>(); |
| 367 | switch (pathPropertyProbe.getSIPInfo().position) { |
| 368 | case SemiMaskPosition::PROHIBIT_PROBE_TO_BUILD: |
| 369 | case SemiMaskPosition::PROHIBIT: |
| 370 | return; |
| 371 | default: |
| 372 | break; |
| 373 | } |
| 374 | if (pathPropertyProbe.getJoinType() == RecursiveJoinType::TRACK_NONE) { |
| 375 | return; |
| 376 | } |
| 377 | auto recursiveRel = pathPropertyProbe.getRel(); |
| 378 | auto nodeID = recursiveRel->getRecursiveInfo()->node->getInternalID(); |
| 379 | std::vector<LogicalOperator*> opsToApplySemiMask; |
| 380 | if (pathPropertyProbe.getNodeChild() != nullptr) { |
| 381 | auto child = pathPropertyProbe.getNodeChild().get(); |
| 382 | for (auto op_ : getScanNodeCandidates(*nodeID, child)) { |
| 383 | opsToApplySemiMask.push_back(op_); |
| 384 | } |
| 385 | } |
| 386 | if (pathPropertyProbe.getRelChild() != nullptr) { |
| 387 | auto child = pathPropertyProbe.getRelChild().get(); |
| 388 | for (auto op_ : getScanNodeCandidates(*nodeID, child)) { |
| 389 | opsToApplySemiMask.push_back(op_); |
| 390 | } |
| 391 | } |
| 392 | if (opsToApplySemiMask.empty()) { |
| 393 | return; |
| 394 | } |
| 395 | DASSERT( |
| 396 | pathPropertyProbe.getChild(0)->getOperatorType() == LogicalOperatorType::RECURSIVE_EXTEND); |
| 397 | auto semiMasker = appendSemiMasker(SemiMaskKeyType::NODE_ID_LIST, SemiMaskTargetType::SCAN_NODE, |
| 398 | recursiveRel->getRecursiveInfo()->bindData->pathNodeIDsExpr, opsToApplySemiMask, |
| 399 | pathPropertyProbe.getChild(0)); |
| 400 | auto srcNodeID = recursiveRel->getSrcNode()->getInternalID(); |
| 401 | auto dstNodeID = recursiveRel->getDstNode()->getInternalID(); |
| 402 | semiMasker->setExtraKeyInfo(std::make_unique<ExtraNodeIDListKeyInfo>(srcNodeID, dstNodeID)); |
| 403 | pathPropertyProbe.setChild(0, semiMasker); |
| 404 | |
| 405 | auto& sipInfo = pathPropertyProbe.getSIPInfoUnsafe(); |
| 406 | sipInfo.position = SemiMaskPosition::ON_PROBE; |
| 407 | sipInfo.dependency = SIPDependency::PROBE_DEPENDS_ON_BUILD; |
| 408 | sipInfo.direction = SIPDirection::PROBE_TO_BUILD; |
| 409 | } |
| 410 | |
| 411 | } // namespace optimizer |
| 412 | } // namespace lbug |
nothing calls this directly
no test coverage detected