MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / visitPathPropertyProbe

Method visitPathPropertyProbe

src/optimizer/acc_hash_join_optimizer.cpp:365–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365void 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

Callers

nothing calls this directly

Calls 13

getScanNodeCandidatesFunction · 0.85
appendSemiMaskerFunction · 0.85
getJoinTypeMethod · 0.80
getRecursiveInfoMethod · 0.80
getNodeChildMethod · 0.80
getRelChildMethod · 0.80
setChildMethod · 0.80
getSIPInfoMethod · 0.45
getRelMethod · 0.45
getMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected