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

Method resetPartialOutputIfNeed

bolt/exec/HashAggregation.cpp:437–462  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void HashAggregation::resetPartialOutputIfNeed() {
438 if (!partialFull_) {
439 return;
440 }
441 BOLT_CHECK(
442 !isGlobal_ && (groupingSet_ == nullptr || !groupingSet_->hasSpilled()));
443 const double aggregationPct =
444 numOutputRows_ == 0 ? 0 : (numOutputRows_ * 1.0) / numInputRows_ * 100;
445 {
446 auto lockedStats = stats_.wlock();
447 lockedStats->addRuntimeStat(
448 "flushRowCount", RuntimeCounter(numOutputRows_));
449 lockedStats->addRuntimeStat("flushTimes", RuntimeCounter(1));
450 lockedStats->addRuntimeStat(
451 "partialAggregationPct", RuntimeCounter(aggregationPct));
452 }
453
454 groupingSet_->resetTable();
455 partialFull_ = false;
456 totalInputRows_ += numInputRows_;
457 if (!finished_) {
458 maybeIncreasePartialAggregationMemoryUsage(aggregationPct);
459 }
460 numOutputRows_ = 0;
461 numInputRows_ = 0;
462}
463
464void HashAggregation::maybeIncreasePartialAggregationMemoryUsage(
465 double aggregationPct) {

Callers

nothing calls this directly

Calls 4

RuntimeCounterClass · 0.85
resetTableMethod · 0.80
hasSpilledMethod · 0.45
addRuntimeStatMethod · 0.45

Tested by

no test coverage detected