Module org.elasticsearch.compute
Interface GroupingAggregatorFunction
- All Superinterfaces:
AutoCloseable,Closeable,org.elasticsearch.core.Releasable
- All Known Implementing Classes:
CountGroupingAggregatorFunction,FromPartialGroupingAggregatorFunction,ToPartialGroupingAggregatorFunction
public interface GroupingAggregatorFunction
extends org.elasticsearch.core.Releasable
Applies some grouping function like
min or avg to many values,
grouped into buckets.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceConsume group ids to cause theGroupingAggregatorFunctionto group values at a particular position into a particular group. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIntermediateInput(int positionOffset, IntVector groupIdVector, Page page) voidaddIntermediateRowInput(int groupId, GroupingAggregatorFunction input, int position) Add the position-th row from the intermediate output of the given aggregator function to the groupIdvoidevaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) Build the final results for this aggregation.voidevaluateIntermediate(Block[] blocks, int offset, IntVector selected) Build the intermediate results for this aggregation.intThe number of blocks used by intermediate state.prepareProcessPage(SeenGroupIds seenGroupIds, Page page) Prepare to process a single page of input.voidselectedMayContainUnseenGroups(SeenGroupIds seenGroupIds) Call this to signal to the aggregation that theselectedparameter that's passed toevaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector)orevaluateFinal(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.operator.DriverContext)may reference groups that haven't been seen.Methods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
prepareProcessPage
Prepare to process a single page of input.This should load the input
Blocks and check their types and select an optimal path and return that path as anGroupingAggregatorFunction.AddInput. -
selectedMayContainUnseenGroups
Call this to signal to the aggregation that theselectedparameter that's passed toevaluateIntermediate(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector)orevaluateFinal(org.elasticsearch.compute.data.Block[], int, org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.operator.DriverContext)may reference groups that haven't been seen. This puts the underlying storage into a mode where it'll track which group ids have been seen, even if that increases the overhead. -
addIntermediateInput
-
addIntermediateRowInput
Add the position-th row from the intermediate output of the given aggregator function to the groupId -
evaluateIntermediate
Build the intermediate results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
evaluateFinal
Build the final results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
intermediateBlockCount
int intermediateBlockCount()The number of blocks used by intermediate state.
-