| 2154 | &aggregateVector); |
| 2155 | } |
| 2156 | if (intermediateRows_) { |
| 2157 | intermediateRows_->eraseRowsSkippingKeys(folly::Range<char**>( |
| 2158 | intermediateGroups_.data(), intermediateGroups_.size())); |
| 2159 | if (intermediateRows_->checkFree()) { |
| 2160 | intermediateRows_->stringAllocator().checkEmpty(); |
| 2161 | } |
| 2162 | } |
| 2163 | |
| 2164 | // It's unnecessary to call function->clear() to reset the internal states of |
| 2165 | // aggregation functions because toIntermediate() is already called at the end |
| 2166 | // of HashAggregation::getOutput(). When toIntermediate() is called, the |
| 2167 | // aggregaiton function instances won't be reused after it returns. |
| 2168 | tempVectors_.clear(); |
| 2169 | } |
| 2170 | |
| 2171 | std::optional<int64_t> GroupingSet::estimateOutputRowSize() const { |
| 2172 | if (table_ == nullptr || table_->numDistinct() == 0) { |
| 2173 | return std::nullopt; |
| 2174 | } |
| 2175 | |
| 2176 | const auto rowSizeFromContainer = table_->rows()->estimateRowSize(); |
| 2177 | if (!hasExternalMemoryAccumulators_) { |
| 2178 | return rowSizeFromContainer; |
nothing calls this directly
no test coverage detected