| 526 | } |
| 527 | |
| 528 | void HashProbe::addSpillInput() { |
| 529 | checkRunning(); |
| 530 | |
| 531 | if (input_ != nullptr || noMoreSpillInput_) { |
| 532 | return; |
| 533 | } |
| 534 | if (FOLLY_UNLIKELY(!spillInputReader_->nextBatch(input_))) { |
| 535 | recordSpillReadStats(); |
| 536 | if (probeRangePartition_ && needLastProbeSideOutput()) { |
| 537 | spillMatchFlagReader_.reset(); |
| 538 | if (matchFlagSpiller_) { |
| 539 | auto&& spilledFlags = matchFlagSpiller_->finishSpill(); |
| 540 | // for next range partition |
| 541 | spillMatchFlagReader_ = spilledFlags.createUnorderedReader(pool()); |
| 542 | matchFlagSpiller_.reset(); |
| 543 | } |
| 544 | } |
| 545 | DeltaCpuWallTimer timer{[this](const CpuWallTiming& timing) { |
| 546 | this->stats().wlock()->finishTiming.add(timing); |
| 547 | }}; |
| 548 | noMoreInputInternal(); |
| 549 | return; |
| 550 | } |
| 551 | |
| 552 | if (probeRangePartition_ && needLastProbeSideOutput()) { |
| 553 | if (spillMatchFlagReader_) { |
| 554 | spillMatchFlagReader_->nextBatch(accumulatedMatchFlag_); |
| 555 | // probe flags's bits should equals input rows's size |
| 556 | BOLT_CHECK(accumulatedMatchFlag_->size() == input_->size()); |
| 557 | } else { |
| 558 | // probe first range partiion |
| 559 | prepareMatchFlag(input_->size(), accumulatedMatchFlag_); |
| 560 | } |
| 561 | } |
| 562 | DeltaCpuWallTimer timer{[this](const CpuWallTiming& timing) { |
| 563 | auto selfDelta = operatorCtx_->driver()->processLazyTiming(*this, timing); |
| 564 | this->stats().wlock()->addInputTiming.add(selfDelta); |
| 565 | }}; |
| 566 | addInput(std::move(input_)); |
| 567 | } |
| 568 | |
| 569 | void HashProbe::spillInput(RowVectorPtr& input) { |
| 570 | BOLT_CHECK(needSpillInput()); |
nothing calls this directly
no test coverage detected