MCPcopy Create free account
hub / github.com/bytedance/bolt / addSpillInput

Method addSpillInput

bolt/exec/HashProbe.cpp:528–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

526}
527
528void 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
569void HashProbe::spillInput(RowVectorPtr& input) {
570 BOLT_CHECK(needSpillInput());

Callers

nothing calls this directly

Calls 10

createUnorderedReaderMethod · 0.80
processLazyTimingMethod · 0.80
driverMethod · 0.80
poolFunction · 0.50
nextBatchMethod · 0.45
resetMethod · 0.45
finishSpillMethod · 0.45
addMethod · 0.45
statsMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected