| 576 | } |
| 577 | |
| 578 | void 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 | |
| 626 | bool GroupingSet::getGlobalAggregationOutput( |
| 627 | RowContainerIterator& iterator, |
nothing calls this directly
no test coverage detected