| 323 | } |
| 324 | |
| 325 | Status BlockingJoinNode::GetFirstProbeRow(RuntimeState* state) { |
| 326 | DCHECK(!probe_side_eos_); |
| 327 | DCHECK_EQ(probe_batch_->num_rows(), 0); |
| 328 | while (true) { |
| 329 | RETURN_IF_ERROR(child(0)->GetNext(state, probe_batch_.get(), &probe_side_eos_)); |
| 330 | COUNTER_ADD(probe_row_counter_, probe_batch_->num_rows()); |
| 331 | probe_batch_pos_ = 0; |
| 332 | if (probe_batch_->num_rows() > 0) { |
| 333 | current_probe_row_ = probe_batch_->GetRow(probe_batch_pos_++); |
| 334 | return Status::OK(); |
| 335 | } else if (probe_side_eos_) { |
| 336 | // If the probe side is exhausted, set the eos_ to true for only those |
| 337 | // join modes that don't need to process unmatched build rows. |
| 338 | eos_ = !NeedToProcessUnmatchedBuildRows(join_op_); |
| 339 | return Status::OK(); |
| 340 | } |
| 341 | probe_batch_->Reset(); |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | template <bool ASYNC_BUILD> |
| 346 | Status BlockingJoinNode::SendBuildInputToSink( |