| 140 | } |
| 141 | |
| 142 | BlockingReason NestedLoopJoinProbe::isBlocked(ContinueFuture* future) { |
| 143 | switch (state_) { |
| 144 | case ProbeOperatorState::kRunning: |
| 145 | [[fallthrough]]; |
| 146 | case ProbeOperatorState::kFinish: |
| 147 | return BlockingReason::kNotBlocked; |
| 148 | case ProbeOperatorState::kWaitForPeers: |
| 149 | if (future_.valid()) { |
| 150 | *future = std::move(future_); |
| 151 | return BlockingReason::kWaitForJoinProbe; |
| 152 | } |
| 153 | setState(ProbeOperatorState::kFinish); |
| 154 | return BlockingReason::kNotBlocked; |
| 155 | case ProbeOperatorState::kWaitForBuild: { |
| 156 | BOLT_CHECK(!buildVectors_.has_value()); |
| 157 | if (!getBuildData(future)) { |
| 158 | return BlockingReason::kWaitForJoinBuild; |
| 159 | } |
| 160 | BOLT_CHECK(buildVectors_.has_value()); |
| 161 | |
| 162 | // If we just got build data, check if this is a right or full join where |
| 163 | // we need to hit track of hits on build records. If it is, initialize the |
| 164 | // selectivity vectors that do so. |
| 165 | if (needsBuildMismatch(joinType_)) { |
| 166 | buildMatched_.resize(buildVectors_->size()); |
| 167 | for (auto i = 0; i < buildVectors_->size(); ++i) { |
| 168 | buildMatched_[i].resizeFill(buildVectors_.value()[i]->size(), false); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | setState(ProbeOperatorState::kRunning); |
| 173 | return BlockingReason::kNotBlocked; |
| 174 | } |
| 175 | default: |
| 176 | BOLT_UNREACHABLE(probeOperatorStateName(state_)); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | void NestedLoopJoinProbe::close() { |
| 181 | if (joinCondition_ != nullptr) { |
nothing calls this directly
no test coverage detected