Module org.elasticsearch.compute
Interface GroupingAggregatorFunction
- All Superinterfaces:
AutoCloseable,Closeable,org.elasticsearch.core.Releasable
- All Known Implementing Classes:
CountApproximateGroupingAggregatorFunction,CountGroupingAggregatorFunction,DenseVectorCountApproximateGroupingAggregatorFunction,DenseVectorCountGroupingAggregatorFunction,DimensionValuesByteRefGroupingAggregatorFunction,FirstDocIdGroupingAggregatorFunction,FromPartialGroupingAggregatorFunction,PresentGroupingAggregatorFunction,RateDoubleGroupingAggregatorFunction,RateIntGroupingAggregatorFunction,RateLongGroupingAggregatorFunction,ToPartialGroupingAggregatorFunction,WindowGroupingAggregatorFunction
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.static interfaceView into the agg that's prepared to emit results. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIntermediateInput(int positionOffset, IntArrayBlock groupIdVector, Page page) voidaddIntermediateInput(int positionOffset, IntBigArrayBlock groupIdVector, Page page) voidaddIntermediateInput(int positionOffset, IntVector groupIdVector, Page page) intThe number of blocks used by intermediate state.prepareEvaluateFinal(IntVector selected, GroupingAggregatorEvaluationContext ctx) Prepare to build the final results for this aggregation.Prepare to build the intermediate results for this aggregation.prepareProcessRawInputPage(SeenGroupIds seenGroupIds, Page page) Returnsnullto opt out of the callback loop for this page entirely, e.g.voidselectedMayContainUnseenGroups(SeenGroupIds seenGroupIds) Call this to signal to the aggregation that theselectedparameter that's passed toprepareEvaluateIntermediate(org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext)orprepareEvaluateFinal(org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext)may reference groups that haven't been seen.Methods inherited from interface org.elasticsearch.core.Releasable
close
-
Method Details
-
prepareProcessRawInputPage
GroupingAggregatorFunction.AddInput prepareProcessRawInputPage(SeenGroupIds seenGroupIds, Page page) Returnsnullto opt out of the callback loop for this page entirely, e.g. when the values block is all-null and contributes nothing to the aggregation. -
selectedMayContainUnseenGroups
Call this to signal to the aggregation that theselectedparameter that's passed toprepareEvaluateIntermediate(org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext)orprepareEvaluateFinal(org.elasticsearch.compute.data.IntVector, org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext)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
-
addIntermediateInput
-
addIntermediateInput
-
prepareEvaluateIntermediate
GroupingAggregatorFunction.PreparedForEvaluation prepareEvaluateIntermediate(IntVector selected, GroupingAggregatorEvaluationContext ctx) Prepare to build the intermediate results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.
-
prepareEvaluateFinal
GroupingAggregatorFunction.PreparedForEvaluation prepareEvaluateFinal(IntVector selected, GroupingAggregatorEvaluationContext ctx) Prepare to build the final results for this aggregation.- Parameters:
selected- the groupIds that have been selected to be included in the results. Always ascending.This function is called in the coordinator node after all intermediate results have been gathered from the worker nodes, and aggregated into intermediate blocks.
-
intermediateBlockCount
int intermediateBlockCount()The number of blocks used by intermediate state.
-