| 237 | } |
| 238 | |
| 239 | static 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 | |
| 265 | static bool isBuildSideQualified(LogicalOperator* buildRoot) { |
| 266 | if (subPlanContainsFilter(buildRoot)) { |
no test coverage detected