This is an automated email from the ASF dual-hosted git repository.
gian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/druid.git
The following commit(s) were added to refs/heads/master by this push:
new cc8b210e4c AggregatorFactory: Use guessAggregatorHeapFootprint when
factorizeWithSize is not implemented. (#14567)
cc8b210e4c is described below
commit cc8b210e4c6acc4f1ccb0af6fe163209357ddf18
Author: Gian Merlino <[email protected]>
AuthorDate: Wed Jul 12 07:33:27 2023 -0700
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.)
---
.../main/java/org/apache/druid/query/aggregation/AggregatorFactory.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java
b/processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java
index 023cb1654e..3e54f449d6 100644
---
a/processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java
+++
b/processing/src/main/java/org/apache/druid/query/aggregation/AggregatorFactory.java
@@ -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));
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]