mirror of https://github.com/apache/druid.git
AggregatorFactory: Use guessAggregatorHeapFootprint when factorizeWithSize is not implemented. (#14567)
There are two ways of estimating heap footprint of an Aggregator: 1) AggregatorFactory#guessAggregatorHeapFootprint 2) AggregatorFactory#factorizeWithSize + Aggregator#aggregateWithSize When the second path is used, the default implementation of factorizeWithSize is now updated to delegate to guessAggregatorHeapFootprint, making these equivalent. The old logic used getMaxIntermediateSize, which is less accurate. Also fixes a bug where, when using the second path, calling factorizeWithSize on PassthroughAggregatorFactory would fail because getMaxIntermediateSize was not implemented. (There is no buffer aggregator, so there would be no need.)
This commit is contained in:
parent
7142b0c39e
commit
cc8b210e4c
|
@ -87,7 +87,7 @@ public abstract class AggregatorFactory implements Cacheable
|
|||
*/
|
||||
public AggregatorAndSize factorizeWithSize(ColumnSelectorFactory metricFactory)
|
||||
{
|
||||
return new AggregatorAndSize(factorize(metricFactory), getMaxIntermediateSize());
|
||||
return new AggregatorAndSize(factorize(metricFactory), guessAggregatorHeapFootprint(0));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue