| 390 | } |
| 391 | |
| 392 | Status PartitionedHashJoinNode::NextProbeRowBatchFromChild( |
| 393 | RuntimeState* state, RowBatch* out_batch, bool* eos) { |
| 394 | DCHECK_ENUM_EQ(builder_->state(), HashJoinState::PARTITIONING_PROBE); |
| 395 | DCHECK_ENUM_EQ(probe_state_, ProbeState::PROBING_END_BATCH); |
| 396 | DCHECK(probe_batch_pos_ == probe_batch_->num_rows() || probe_batch_pos_ == -1); |
| 397 | *eos = false; |
| 398 | do { |
| 399 | // Loop until we find a non-empty row batch. |
| 400 | probe_batch_->TransferResourceOwnership(out_batch); |
| 401 | if (out_batch->AtCapacity()) { |
| 402 | // This out batch is full. Need to return it before getting the next batch. |
| 403 | probe_batch_pos_ = -1; |
| 404 | return Status::OK(); |
| 405 | } |
| 406 | if (probe_side_eos_) { |
| 407 | current_probe_row_ = nullptr; |
| 408 | probe_batch_pos_ = -1; |
| 409 | *eos = true; |
| 410 | return Status::OK(); |
| 411 | } |
| 412 | RETURN_IF_ERROR(child(0)->GetNext(state, probe_batch_.get(), &probe_side_eos_)); |
| 413 | COUNTER_ADD(probe_row_counter_, probe_batch_->num_rows()); |
| 414 | } while (probe_batch_->num_rows() == 0); |
| 415 | |
| 416 | ResetForProbe(); |
| 417 | return Status::OK(); |
| 418 | } |
| 419 | |
| 420 | Status PartitionedHashJoinNode::NextSpilledProbeRowBatch( |
| 421 | RuntimeState* state, RowBatch* out_batch, bool* eos) { |
nothing calls this directly
no test coverage detected