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

Method estimateOutputRowSize

bolt/exec/GroupingSet.cpp:2156–2175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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
2171std::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;

Callers

nothing calls this directly

Calls 5

value_orMethod · 0.80
numDistinctMethod · 0.45
estimateRowSizeMethod · 0.45
rowsMethod · 0.45
currentBytesMethod · 0.45

Tested by

no test coverage detected