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

Method getGlobalAggregationOutput

bolt/exec/GroupingSet.cpp:626–661  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

624 }
625}
626
627bool GroupingSet::getGlobalAggregationOutput(
628 RowContainerIterator& iterator,
629 RowVectorPtr& result) {
630 if (iterator.allocationIndex != 0) {
631 return false;
632 }
633
634 initializeGlobalAggregation();
635
636 auto groups = lookup_->hits.data();
637 for (int32_t i = 0; i < aggregates_.size(); ++i) {
638 if (!aggregates_[i].sortingKeys.empty()) {
639 continue;
640 }
641
642 auto& function = aggregates_[i].function;
643 if (isPartial_) {
644 function->extractAccumulators(groups, 1, &result->childAt(i));
645 } else {
646 function->extractValues(groups, 1, &result->childAt(i));
647 }
648 }
649
650 if (sortedAggregations_) {
651 sortedAggregations_->extractValues(folly::Range(groups, 1), result);
652 }
653
654 for (const auto& aggregation : distinctAggregations_) {
655 if (aggregation != nullptr) {
656 aggregation->extractValues(folly::Range(groups, 1), result);
657 }
658 }
659
660 iterator.allocationIndex = std::numeric_limits<int32_t>::max();
661 return true;
662}
663
664bool GroupingSet::getDefaultGlobalGroupingSetOutput(

Callers

nothing calls this directly

Calls 8

childAtMethod · 0.80
RangeClass · 0.50
maxFunction · 0.50
dataMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
extractAccumulatorsMethod · 0.45
extractValuesMethod · 0.45

Tested by

no test coverage detected