Class ToPartialGroupingAggregatorFunction

java.lang.Object
org.elasticsearch.compute.aggregation.ToPartialGroupingAggregatorFunction
All Implemented Interfaces:
Closeable, AutoCloseable, GroupingAggregatorFunction, org.elasticsearch.core.Releasable

public class ToPartialGroupingAggregatorFunction extends Object implements GroupingAggregatorFunction
An internal aggregate function that always emits intermediate (or partial) output regardless of the aggregate mode. The intermediate output should be consumed by FromPartialGroupingAggregatorFunction, which always receives the intermediate input. Since an intermediate aggregate output can consist of multiple blocks, we wrap these output blocks in a single composite block. The FromPartialGroupingAggregatorFunction then unwraps this input block into multiple primitive blocks and passes them to the delegating GroupingAggregatorFunction. Both of these commands yield the same result, except the second plan executes aggregates twice:
 ```
 | ... before
 | af(x) BY g
 | ... after
 ```
 ```
 | ... before
 | $x = to_partial(af(x)) BY g
 | from_partial($x, af(_)) BY g
 | ...  after
 
```