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

Function tryProbeToBuildHJSIP

src/optimizer/acc_hash_join_optimizer.cpp:239–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

237}
238
239static bool tryProbeToBuildHJSIP(LogicalOperator* op) {
240 auto& hashJoin = op->cast<LogicalHashJoin>();
241 if (!isProbeSideQualified(op->getChild(0).get())) {
242 return false;
243 }
244 auto probeRoot = hashJoin.getChild(0);
245 auto buildRoot = hashJoin.getChild(1);
246 auto hasSemiMaskApplied = false;
247 for (auto& nodeID : hashJoin.getJoinNodeIDs()) {
248 auto newProbeRoot = tryApplySemiMask(nodeID, probeRoot, buildRoot.get());
249 if (newProbeRoot != nullptr) {
250 probeRoot = newProbeRoot;
251 hasSemiMaskApplied = true;
252 }
253 }
254 if (!hasSemiMaskApplied) {
255 return false;
256 }
257 auto& sipInfo = hashJoin.getSIPInfoUnsafe();
258 sipInfo.position = SemiMaskPosition::ON_PROBE;
259 sipInfo.dependency = SIPDependency::PROBE_DEPENDS_ON_BUILD;
260 sipInfo.direction = SIPDirection::PROBE_TO_BUILD;
261 hashJoin.setChild(0, appendAccumulate(probeRoot));
262 return true;
263}
264
265static bool isBuildSideQualified(LogicalOperator* buildRoot) {
266 if (subPlanContainsFilter(buildRoot)) {

Callers 1

visitHashJoinMethod · 0.85

Calls 7

isProbeSideQualifiedFunction · 0.85
tryApplySemiMaskFunction · 0.85
appendAccumulateFunction · 0.85
getJoinNodeIDsMethod · 0.80
setChildMethod · 0.80
getMethod · 0.45
getChildMethod · 0.45

Tested by

no test coverage detected