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

Method addGlobalAggregationInput

bolt/exec/GroupingSet.cpp:578–624  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578void GroupingSet::addGlobalAggregationInput(
579 const RowVectorPtr& input,
580 bool mayPushdown) {
581 initializeGlobalAggregation();
582
583 auto numRows = input->size();
584 activeRows_.resize(numRows);
585 activeRows_.setAll();
586
587 masks_.addInput(input, activeRows_);
588
589 auto* group = lookup_->hits[0];
590
591 for (auto i = 0; i < aggregates_.size(); ++i) {
592 if (!aggregates_[i].sortingKeys.empty()) {
593 continue;
594 }
595 const auto& rows = getSelectivityVector(i);
596
597 // Check is mask is false for all rows.
598 if (!rows.hasSelections()) {
599 continue;
600 }
601
602 if (aggregates_[i].distinct) {
603 distinctAggregations_[i]->addSingleGroupInput(group, input, rows);
604 continue;
605 }
606
607 auto& function = aggregates_[i].function;
608
609 populateTempVectors(i, input);
610 const bool canPushdown =
611 mayPushdown && mayPushdown_[i] && areAllLazyNotLoaded(tempVectors_);
612 if (isRawInput_) {
613 function->addSingleGroupRawInput(group, rows, tempVectors_, canPushdown);
614 } else {
615 function->addSingleGroupIntermediateResults(
616 group, rows, tempVectors_, canPushdown);
617 }
618 }
619 tempVectors_.clear();
620
621 if (sortedAggregations_) {
622 sortedAggregations_->addSingleGroupInput(group, input);
623 }
624}
625
626bool GroupingSet::getGlobalAggregationOutput(
627 RowContainerIterator& iterator,

Callers

nothing calls this directly

Calls 11

areAllLazyNotLoadedFunction · 0.85
setAllMethod · 0.80
hasSelectionsMethod · 0.80
sizeMethod · 0.45
resizeMethod · 0.45
addInputMethod · 0.45
emptyMethod · 0.45
addSingleGroupInputMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected