diff --git a/x-pack/plugin/esql/compute/ann/src/main/java/org/elasticsearch/compute/ann/GroupingAggregator.java b/x-pack/plugin/esql/compute/ann/src/main/java/org/elasticsearch/compute/ann/GroupingAggregator.java index 8d81b60e20e4d..03565ab92667d 100644 --- a/x-pack/plugin/esql/compute/ann/src/main/java/org/elasticsearch/compute/ann/GroupingAggregator.java +++ b/x-pack/plugin/esql/compute/ann/src/main/java/org/elasticsearch/compute/ann/GroupingAggregator.java @@ -29,7 +29,7 @@ Class[] warnExceptions() default {}; /** - * If {@code true} then the @timestamp LongVector will be appended to the input blocks of the aggregation function. + * {@code true} if this is a time-series aggregation */ - boolean includeTimestamps() default false; + boolean timeseries() default false; } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorProcessor.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorProcessor.java index 3ad2343ad1658..0b3b10c92b96c 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorProcessor.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorProcessor.java @@ -107,7 +107,7 @@ public boolean process(Set set, RoundEnvironment roundEnv aggClass, intermediateState, warnExceptionsTypes, - aggClass.getAnnotation(GroupingAggregator.class).includeTimestamps() + aggClass.getAnnotation(GroupingAggregator.class).timeseries() ); write(aggClass, "grouping aggregator", groupingAggregatorImplementer.sourceFile(), env); } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/GroupingAggregatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/GroupingAggregatorImplementer.java index d2b6a0e011687..f42138c3eceb6 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/GroupingAggregatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/GroupingAggregatorImplementer.java @@ -50,6 +50,7 @@ import static org.elasticsearch.compute.gen.Types.BYTES_REF; import static org.elasticsearch.compute.gen.Types.DRIVER_CONTEXT; import static org.elasticsearch.compute.gen.Types.ELEMENT_TYPE; +import static org.elasticsearch.compute.gen.Types.GROUPING_AGGREGATOR_EVALUATOR_CONTEXT; import static org.elasticsearch.compute.gen.Types.GROUPING_AGGREGATOR_FUNCTION; import static org.elasticsearch.compute.gen.Types.GROUPING_AGGREGATOR_FUNCTION_ADD_INPUT; import static org.elasticsearch.compute.gen.Types.INTERMEDIATE_STATE_DESC; @@ -82,7 +83,7 @@ public class GroupingAggregatorImplementer { private final List createParameters; private final ClassName implementation; private final List intermediateState; - private final boolean includeTimestampVector; + private final boolean timseries; private final AggregationState aggState; private final AggregationParameter aggParam; @@ -92,7 +93,7 @@ public GroupingAggregatorImplementer( TypeElement declarationType, IntermediateState[] interStateAnno, List warnExceptions, - boolean includeTimestampVector + boolean timseries ) { this.declarationType = declarationType; this.warnExceptions = warnExceptions; @@ -109,7 +110,7 @@ public GroupingAggregatorImplementer( declarationType, aggState.declaredType().isPrimitive() ? requireType(aggState.declaredType()) : requireVoidType(), requireName("combine"), - combineArgs(aggState, includeTimestampVector) + combineArgs(aggState, timseries) ); // TODO support multiple parameters this.aggParam = AggregationParameter.create(combine.getParameters().getLast().asType()); @@ -128,7 +129,7 @@ public GroupingAggregatorImplementer( this.intermediateState = Arrays.stream(interStateAnno) .map(AggregatorImplementer.IntermediateStateDesc::newIntermediateStateDesc) .toList(); - this.includeTimestampVector = includeTimestampVector; + this.timseries = timseries; } private static Methods.ArgumentMatcher combineArgs(AggregationState aggState, boolean includeTimestampVector) { @@ -318,7 +319,7 @@ private MethodSpec prepareProcessPage() { builder.addStatement("$T valuesBlock = page.getBlock(channels.get(0))", blockType(aggParam.type())); builder.addStatement("$T valuesVector = valuesBlock.asVector()", vectorType(aggParam.type())); - if (includeTimestampVector) { + if (timseries) { builder.addStatement("$T timestampsBlock = page.getBlock(channels.get(1))", LONG_BLOCK); builder.addStatement("$T timestampsVector = timestampsBlock.asVector()", LONG_VECTOR); @@ -327,7 +328,7 @@ private MethodSpec prepareProcessPage() { builder.endControlFlow(); } builder.beginControlFlow("if (valuesVector == null)"); - String extra = includeTimestampVector ? ", timestampsVector" : ""; + String extra = timseries ? ", timestampsVector" : ""; { builder.beginControlFlow("if (valuesBlock.mayHaveNulls())"); builder.addStatement("state.enableGroupIdTracking(seenGroupIds)"); @@ -373,7 +374,7 @@ private MethodSpec addRawInputLoop(TypeName groupsType, TypeName valuesType) { MethodSpec.Builder builder = MethodSpec.methodBuilder("addRawInput"); builder.addModifiers(Modifier.PRIVATE); builder.addParameter(TypeName.INT, "positionOffset").addParameter(groupsType, "groups").addParameter(valuesType, "values"); - if (includeTimestampVector) { + if (timseries) { builder.addParameter(LONG_VECTOR, "timestamps"); } if (aggParam.isBytesRef()) { @@ -456,7 +457,7 @@ private void combineRawInput(MethodSpec.Builder builder, String blockVariable, S private void combineRawInputForBytesRef(MethodSpec.Builder builder, String blockVariable, String offsetVariable) { // scratch is a BytesRef var that must have been defined before the iteration starts - if (includeTimestampVector) { + if (timseries) { if (offsetVariable.contains(" + ")) { builder.addStatement("var valuePosition = $L", offsetVariable); offsetVariable = "valuePosition"; @@ -474,7 +475,7 @@ private void combineRawInputForBytesRef(MethodSpec.Builder builder, String block } private void combineRawInputForPrimitive(MethodSpec.Builder builder, String blockVariable, String offsetVariable) { - if (includeTimestampVector) { + if (timseries) { if (offsetVariable.contains(" + ")) { builder.addStatement("var valuePosition = $L", offsetVariable); offsetVariable = "valuePosition"; @@ -498,7 +499,7 @@ private void combineRawInputForPrimitive(MethodSpec.Builder builder, String bloc } private void combineRawInputForVoid(MethodSpec.Builder builder, String blockVariable, String offsetVariable) { - if (includeTimestampVector) { + if (timseries) { if (offsetVariable.contains(" + ")) { builder.addStatement("var valuePosition = $L", offsetVariable); offsetVariable = "valuePosition"; @@ -683,10 +684,22 @@ private MethodSpec evaluateFinal() { .addParameter(BLOCK_ARRAY, "blocks") .addParameter(TypeName.INT, "offset") .addParameter(INT_VECTOR, "selected") - .addParameter(DRIVER_CONTEXT, "driverContext"); + .addParameter(GROUPING_AGGREGATOR_EVALUATOR_CONTEXT, "evaluatorContext"); if (aggState.declaredType().isPrimitive()) { - builder.addStatement("blocks[offset] = state.toValuesBlock(selected, driverContext)"); + builder.addStatement("blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext())"); + } else if (timseries) { + requireStaticMethod( + declarationType, + requireType(BLOCK), + requireName("evaluateFinal"), + requireArgs( + requireType(aggState.declaredType()), + requireType(INT_VECTOR), + requireType(GROUPING_AGGREGATOR_EVALUATOR_CONTEXT) + ) + ); + builder.addStatement("blocks[offset] = $T.evaluateFinal(state, selected, evaluatorContext)", declarationType); } else { requireStaticMethod( declarationType, @@ -694,7 +707,7 @@ private MethodSpec evaluateFinal() { requireName("evaluateFinal"), requireArgs(requireType(aggState.declaredType()), requireType(INT_VECTOR), requireType(DRIVER_CONTEXT)) ); - builder.addStatement("blocks[offset] = $T.evaluateFinal(state, selected, driverContext)", declarationType); + builder.addStatement("blocks[offset] = $T.evaluateFinal(state, selected, evaluatorContext.driverContext())", declarationType); } return builder.build(); } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java index 5c18453161a13..62ecee6b5c6e9 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java @@ -97,6 +97,10 @@ public class Types { static final TypeName LIST_AGG_FUNC_DESC = ParameterizedTypeName.get(ClassName.get(List.class), INTERMEDIATE_STATE_DESC); static final ClassName DRIVER_CONTEXT = ClassName.get(OPERATOR_PACKAGE, "DriverContext"); + static final ClassName GROUPING_AGGREGATOR_EVALUATOR_CONTEXT = ClassName.get( + AGGREGATION_PACKAGE, + "GroupingAggregatorEvaluationContext" + ); static final ClassName EXPRESSION_EVALUATOR = ClassName.get(OPERATOR_PACKAGE, "EvalOperator", "ExpressionEvaluator"); static final ClassName EXPRESSION_EVALUATOR_FACTORY = ClassName.get(OPERATOR_PACKAGE, "EvalOperator", "ExpressionEvaluator", "Factory"); diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateDoubleAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateDoubleAggregator.java index deec1ef04f623..e412ec91bf5ee 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateDoubleAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateDoubleAggregator.java @@ -31,7 +31,7 @@ * This class is generated. Edit `X-RateAggregator.java.st` instead. */ @GroupingAggregator( - includeTimestamps = true, + timeseries = true, value = { @IntermediateState(name = "timestamps", type = "LONG_BLOCK"), @IntermediateState(name = "values", type = "DOUBLE_BLOCK"), @@ -67,8 +67,12 @@ public static void combineStates( current.combineState(currentGroupId, otherState, otherGroupId); } - public static Block evaluateFinal(DoubleRateGroupingState state, IntVector selected, DriverContext driverContext) { - return state.evaluateFinal(selected, driverContext.blockFactory()); + public static Block evaluateFinal( + DoubleRateGroupingState state, + IntVector selected, + GroupingAggregatorEvaluationContext evaluatorContext + ) { + return state.evaluateFinal(selected, evaluatorContext.blockFactory()); } private static class DoubleRateState { diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateFloatAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateFloatAggregator.java index 94ad5254bc723..dcb54a6c18813 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateFloatAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateFloatAggregator.java @@ -32,7 +32,7 @@ * This class is generated. Edit `X-RateAggregator.java.st` instead. */ @GroupingAggregator( - includeTimestamps = true, + timeseries = true, value = { @IntermediateState(name = "timestamps", type = "LONG_BLOCK"), @IntermediateState(name = "values", type = "FLOAT_BLOCK"), @@ -68,8 +68,12 @@ public static void combineStates( current.combineState(currentGroupId, otherState, otherGroupId); } - public static Block evaluateFinal(FloatRateGroupingState state, IntVector selected, DriverContext driverContext) { - return state.evaluateFinal(selected, driverContext.blockFactory()); + public static Block evaluateFinal( + FloatRateGroupingState state, + IntVector selected, + GroupingAggregatorEvaluationContext evaluatorContext + ) { + return state.evaluateFinal(selected, evaluatorContext.blockFactory()); } private static class FloatRateState { diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateIntAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateIntAggregator.java index 011291dd08c52..f8e0c0b70aed2 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateIntAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateIntAggregator.java @@ -32,7 +32,7 @@ * This class is generated. Edit `X-RateAggregator.java.st` instead. */ @GroupingAggregator( - includeTimestamps = true, + timeseries = true, value = { @IntermediateState(name = "timestamps", type = "LONG_BLOCK"), @IntermediateState(name = "values", type = "INT_BLOCK"), @@ -68,8 +68,12 @@ public static void combineStates( current.combineState(currentGroupId, otherState, otherGroupId); } - public static Block evaluateFinal(IntRateGroupingState state, IntVector selected, DriverContext driverContext) { - return state.evaluateFinal(selected, driverContext.blockFactory()); + public static Block evaluateFinal( + IntRateGroupingState state, + IntVector selected, + GroupingAggregatorEvaluationContext evaluatorContext + ) { + return state.evaluateFinal(selected, evaluatorContext.blockFactory()); } private static class IntRateState { diff --git a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateLongAggregator.java b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateLongAggregator.java index 9ccb5d3bd1b1a..ba636accf7a78 100644 --- a/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateLongAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/generated-src/org/elasticsearch/compute/aggregation/RateLongAggregator.java @@ -31,7 +31,7 @@ * This class is generated. Edit `X-RateAggregator.java.st` instead. */ @GroupingAggregator( - includeTimestamps = true, + timeseries = true, value = { @IntermediateState(name = "timestamps", type = "LONG_BLOCK"), @IntermediateState(name = "values", type = "LONG_BLOCK"), @@ -67,8 +67,12 @@ public static void combineStates( current.combineState(currentGroupId, otherState, otherGroupId); } - public static Block evaluateFinal(LongRateGroupingState state, IntVector selected, DriverContext driverContext) { - return state.evaluateFinal(selected, driverContext.blockFactory()); + public static Block evaluateFinal( + LongRateGroupingState state, + IntVector selected, + GroupingAggregatorEvaluationContext evaluatorContext + ) { + return state.evaluateFinal(selected, evaluatorContext.blockFactory()); } private static class LongRateState { diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBooleanGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBooleanGroupingAggregatorFunction.java index fb172567d7021..d031450a77f56 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBooleanGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBooleanGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = CountDistinctBooleanAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = CountDistinctBooleanAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefGroupingAggregatorFunction.java index 5d4096de08417..fec083927d5d6 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefGroupingAggregatorFunction.java @@ -197,8 +197,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = CountDistinctBytesRefAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = CountDistinctBytesRefAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleGroupingAggregatorFunction.java index d6d335dc6d0f0..756e922913841 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = CountDistinctDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = CountDistinctDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatGroupingAggregatorFunction.java index d9e745113689f..1462deb1aab91 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = CountDistinctFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = CountDistinctFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntGroupingAggregatorFunction.java index ae06526aa5317..2145489c67096 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntGroupingAggregatorFunction.java @@ -193,8 +193,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = CountDistinctIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = CountDistinctIntAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongGroupingAggregatorFunction.java index 685cb2f0e5dcf..20ae39cdbcd19 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = CountDistinctLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = CountDistinctLongAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBooleanGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBooleanGroupingAggregatorFunction.java index 915e481f2661f..5e2684b85c8db 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBooleanGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBooleanGroupingAggregatorFunction.java @@ -199,8 +199,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefGroupingAggregatorFunction.java index f15976bcdc61d..52bc763449f59 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MaxBytesRefAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MaxBytesRefAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxDoubleGroupingAggregatorFunction.java index c8f28f0dfd865..0b2e5cca5d244 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxDoubleGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxFloatGroupingAggregatorFunction.java index 89d3c8dae28ba..4ec8212a2da62 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxFloatGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIntGroupingAggregatorFunction.java index 4d86001ac669d..024d0db097b29 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIntGroupingAggregatorFunction.java @@ -199,8 +199,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpGroupingAggregatorFunction.java index 8b25dcc293159..805fc77aa9306 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MaxIpAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MaxIpAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxLongGroupingAggregatorFunction.java index 9573945dc7d53..5d6fa43723e7b 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxLongGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleGroupingAggregatorFunction.java index 291737cf1c21b..9091515805dff 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleGroupingAggregatorFunction.java @@ -192,8 +192,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MedianAbsoluteDeviationDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MedianAbsoluteDeviationDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatGroupingAggregatorFunction.java index fe44034fbd6b8..1649e40d9045d 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatGroupingAggregatorFunction.java @@ -192,8 +192,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MedianAbsoluteDeviationFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MedianAbsoluteDeviationFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntGroupingAggregatorFunction.java index b79c1829c2c22..5904bef3956d3 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntGroupingAggregatorFunction.java @@ -190,8 +190,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MedianAbsoluteDeviationIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MedianAbsoluteDeviationIntAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongGroupingAggregatorFunction.java index acefb4a683811..bb50db9998a59 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongGroupingAggregatorFunction.java @@ -192,8 +192,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MedianAbsoluteDeviationLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MedianAbsoluteDeviationLongAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBooleanGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBooleanGroupingAggregatorFunction.java index ffad2a58c5d41..10bb3ca5c60bf 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBooleanGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBooleanGroupingAggregatorFunction.java @@ -199,8 +199,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefGroupingAggregatorFunction.java index 01adcea310b46..29d96b63a8e59 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MinBytesRefAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MinBytesRefAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinDoubleGroupingAggregatorFunction.java index 5c19d45fa16b8..c1396235fef0c 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinDoubleGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinFloatGroupingAggregatorFunction.java index e92d9b44d18c8..daadf3d7dbb53 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinFloatGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIntGroupingAggregatorFunction.java index 7cf3a99f15e2e..8f92c63096766 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIntGroupingAggregatorFunction.java @@ -199,8 +199,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpGroupingAggregatorFunction.java index abb8e1cd89fcd..05a5c3b57e2a6 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = MinIpAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = MinIpAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinLongGroupingAggregatorFunction.java index 87971c66fcda8..c6421afa46211 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinLongGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleGroupingAggregatorFunction.java index d455c4ad0a15a..a2ba67333a05d 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = PercentileDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = PercentileDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatGroupingAggregatorFunction.java index 5b2649a57167a..4c24b1b4221c6 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = PercentileFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = PercentileFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntGroupingAggregatorFunction.java index 2aef3e76b00f4..97ce87021f4f8 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntGroupingAggregatorFunction.java @@ -193,8 +193,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = PercentileIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = PercentileIntAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongGroupingAggregatorFunction.java index 3330e630235da..f2680fd7b5bef 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = PercentileLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = PercentileLongAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateDoubleGroupingAggregatorFunction.java index 5a2f4203cf49f..cf0749fcf9e99 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateDoubleGroupingAggregatorFunction.java @@ -218,8 +218,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = RateDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = RateDoubleAggregator.evaluateFinal(state, selected, evaluatorContext); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateFloatGroupingAggregatorFunction.java index 1048c93223b9e..b3c346c12e31f 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateFloatGroupingAggregatorFunction.java @@ -220,8 +220,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = RateFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = RateFloatAggregator.evaluateFinal(state, selected, evaluatorContext); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateIntGroupingAggregatorFunction.java index 00ea9986de165..769c7b126a24f 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateIntGroupingAggregatorFunction.java @@ -218,8 +218,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = RateIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = RateIntAggregator.evaluateFinal(state, selected, evaluatorContext); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateLongGroupingAggregatorFunction.java index 30cc10bf67077..1cee7d6845130 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/RateLongGroupingAggregatorFunction.java @@ -218,8 +218,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = RateLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = RateLongAggregator.evaluateFinal(state, selected, evaluatorContext); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevDoubleGroupingAggregatorFunction.java index d15c35f9324a9..bbf1930cf0524 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevDoubleGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = StdDevDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = StdDevDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevFloatGroupingAggregatorFunction.java index ec7a319cd0752..818dd28386b9f 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevFloatGroupingAggregatorFunction.java @@ -205,8 +205,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = StdDevFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = StdDevFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevIntGroupingAggregatorFunction.java index 747d0a53c139c..d8417d71dc784 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevIntGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = StdDevIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = StdDevIntAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevLongGroupingAggregatorFunction.java index dff7e3a204732..fc5f061a04620 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/StdDevLongGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = StdDevLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = StdDevLongAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumDoubleGroupingAggregatorFunction.java index ca7b452e121d0..d566756ca3282 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumDoubleGroupingAggregatorFunction.java @@ -203,8 +203,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SumDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SumDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumFloatGroupingAggregatorFunction.java index ea5a876b2432b..e12f91f4451a8 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumFloatGroupingAggregatorFunction.java @@ -205,8 +205,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SumFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SumFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumIntGroupingAggregatorFunction.java index d734f42df7038..91c04d9370060 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumIntGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumLongGroupingAggregatorFunction.java index a2feb10cff580..e53dfa3857753 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SumLongGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = state.toValuesBlock(selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = state.toValuesBlock(selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBooleanGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBooleanGroupingAggregatorFunction.java index 108e0a0704ec8..dc0e2831ee3ea 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBooleanGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBooleanGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopBooleanAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopBooleanAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefGroupingAggregatorFunction.java index 45514ee343668..aa779dfc4afad 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopBytesRefAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopBytesRefAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopDoubleGroupingAggregatorFunction.java index 956c7b8ae5595..68bdee76e48aa 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopDoubleGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopFloatGroupingAggregatorFunction.java index 712277798e65c..cf1063a02fcbf 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopFloatGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIntGroupingAggregatorFunction.java index 0581c0f244964..67fa432b87995 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIntGroupingAggregatorFunction.java @@ -193,8 +193,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopIntAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpGroupingAggregatorFunction.java index bfcdadfa54814..eb5631c68d173 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpGroupingAggregatorFunction.java @@ -201,8 +201,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopIpAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopIpAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopLongGroupingAggregatorFunction.java index d5ebeca1f174c..58b62c211a0b9 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopLongGroupingAggregatorFunction.java @@ -195,8 +195,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = TopLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = TopLongAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBooleanGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBooleanGroupingAggregatorFunction.java index 81da1f65e9bee..772de15468ef3 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBooleanGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBooleanGroupingAggregatorFunction.java @@ -188,8 +188,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = ValuesBooleanAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = ValuesBooleanAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefGroupingAggregatorFunction.java index 6db44ffce8faf..93d060889d28f 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefGroupingAggregatorFunction.java @@ -194,8 +194,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = ValuesBytesRefAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = ValuesBytesRefAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesDoubleGroupingAggregatorFunction.java index 893d8fcd2ea5d..04984d5c0640a 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesDoubleGroupingAggregatorFunction.java @@ -188,8 +188,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = ValuesDoubleAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = ValuesDoubleAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesFloatGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesFloatGroupingAggregatorFunction.java index 8afd75384aa87..1848b9e4f141b 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesFloatGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesFloatGroupingAggregatorFunction.java @@ -188,8 +188,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = ValuesFloatAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = ValuesFloatAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesIntGroupingAggregatorFunction.java index 468320a69fc98..f0878fb085e6a 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesIntGroupingAggregatorFunction.java @@ -186,8 +186,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = ValuesIntAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = ValuesIntAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesLongGroupingAggregatorFunction.java index cc6e7121c5afb..00bd36cda2523 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesLongGroupingAggregatorFunction.java @@ -188,8 +188,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = ValuesLongAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = ValuesLongAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointDocValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointDocValuesGroupingAggregatorFunction.java index 80c5643ea0a6c..9a6328f075bca 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointDocValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointDocValuesGroupingAggregatorFunction.java @@ -9,6 +9,7 @@ import java.lang.String; import java.lang.StringBuilder; import java.util.List; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -218,8 +219,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialCentroidCartesianPointDocValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialCentroidCartesianPointDocValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointSourceValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointSourceValuesGroupingAggregatorFunction.java index f767d5e39d1d1..1681b1a210d3c 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointSourceValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidCartesianPointSourceValuesGroupingAggregatorFunction.java @@ -10,6 +10,7 @@ import java.lang.StringBuilder; import java.util.List; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -225,8 +226,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialCentroidCartesianPointSourceValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialCentroidCartesianPointSourceValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointDocValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointDocValuesGroupingAggregatorFunction.java index ce99c9086cca3..36413308e967f 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointDocValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointDocValuesGroupingAggregatorFunction.java @@ -9,6 +9,7 @@ import java.lang.String; import java.lang.StringBuilder; import java.util.List; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -218,8 +219,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialCentroidGeoPointDocValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialCentroidGeoPointDocValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointSourceValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointSourceValuesGroupingAggregatorFunction.java index bb07444e913ae..935dd8f56887a 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointSourceValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialCentroidGeoPointSourceValuesGroupingAggregatorFunction.java @@ -10,6 +10,7 @@ import java.lang.StringBuilder; import java.util.List; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -225,8 +226,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialCentroidGeoPointSourceValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialCentroidGeoPointSourceValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointDocValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointDocValuesGroupingAggregatorFunction.java index c528cef4d3863..8a9807be22ef5 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointDocValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointDocValuesGroupingAggregatorFunction.java @@ -9,6 +9,7 @@ import java.lang.String; import java.lang.StringBuilder; import java.util.List; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -210,8 +211,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentCartesianPointDocValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentCartesianPointDocValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointSourceValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointSourceValuesGroupingAggregatorFunction.java index 7ee441fe88f16..49198bbd74c69 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointSourceValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianPointSourceValuesGroupingAggregatorFunction.java @@ -10,6 +10,7 @@ import java.lang.StringBuilder; import java.util.List; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -215,8 +216,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentCartesianPointSourceValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentCartesianPointSourceValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeDocValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeDocValuesGroupingAggregatorFunction.java index 48161b3ea4bf3..ca6b567810ae7 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeDocValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeDocValuesGroupingAggregatorFunction.java @@ -9,6 +9,7 @@ import java.lang.String; import java.lang.StringBuilder; import java.util.List; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -199,8 +200,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentCartesianShapeDocValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentCartesianShapeDocValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeSourceValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeSourceValuesGroupingAggregatorFunction.java index 77893dd350b86..bf7e95c4f040f 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeSourceValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentCartesianShapeSourceValuesGroupingAggregatorFunction.java @@ -10,6 +10,7 @@ import java.lang.StringBuilder; import java.util.List; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -215,8 +216,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentCartesianShapeSourceValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentCartesianShapeSourceValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointDocValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointDocValuesGroupingAggregatorFunction.java index 235bd10c3e8e2..71abb7296232a 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointDocValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointDocValuesGroupingAggregatorFunction.java @@ -9,6 +9,7 @@ import java.lang.String; import java.lang.StringBuilder; import java.util.List; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -222,8 +223,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentGeoPointDocValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentGeoPointDocValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointSourceValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointSourceValuesGroupingAggregatorFunction.java index d1c715d5b5f35..437c1f017ebc9 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointSourceValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoPointSourceValuesGroupingAggregatorFunction.java @@ -10,6 +10,7 @@ import java.lang.StringBuilder; import java.util.List; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -227,8 +228,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentGeoPointSourceValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentGeoPointSourceValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeDocValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeDocValuesGroupingAggregatorFunction.java index 00df4fe3282e6..b0a01d268280c 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeDocValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeDocValuesGroupingAggregatorFunction.java @@ -9,6 +9,7 @@ import java.lang.String; import java.lang.StringBuilder; import java.util.List; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -211,8 +212,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentGeoShapeDocValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentGeoShapeDocValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeSourceValuesGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeSourceValuesGroupingAggregatorFunction.java index c9be8deaf649c..029e935f4765e 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeSourceValuesGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/spatial/SpatialExtentGeoShapeSourceValuesGroupingAggregatorFunction.java @@ -10,6 +10,7 @@ import java.lang.StringBuilder; import java.util.List; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.IntermediateStateDesc; import org.elasticsearch.compute.aggregation.SeenGroupIds; @@ -227,8 +228,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) @Override public void evaluateFinal(Block[] blocks, int offset, IntVector selected, - DriverContext driverContext) { - blocks[offset] = SpatialExtentGeoShapeSourceValuesAggregator.evaluateFinal(state, selected, driverContext); + GroupingAggregatorEvaluationContext evaluatorContext) { + blocks[offset] = SpatialExtentGeoShapeSourceValuesAggregator.evaluateFinal(state, selected, evaluatorContext.driverContext()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountGroupingAggregatorFunction.java index e107a73f7ab1e..124fb5a1745bd 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/CountGroupingAggregatorFunction.java @@ -190,8 +190,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) } @Override - public void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) { - try (LongVector.Builder builder = driverContext.blockFactory().newLongVectorFixedBuilder(selected.getPositionCount())) { + public void evaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) { + try (LongVector.Builder builder = evaluationContext.blockFactory().newLongVectorFixedBuilder(selected.getPositionCount())) { for (int i = 0; i < selected.getPositionCount(); i++) { int si = selected.getInt(i); builder.appendLong(state.hasValue(si) ? state.get(si) : 0); diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunction.java index 8d3dbf3164c47..f34129c1116e4 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunction.java @@ -14,7 +14,6 @@ import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.data.ToMask; -import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.core.Releasables; @@ -106,8 +105,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) } @Override - public void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) { - next.evaluateFinal(blocks, offset, selected, driverContext); + public void evaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) { + next.evaluateFinal(blocks, offset, selected, evaluationContext); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialAggregatorFunction.java index 1f6270528593c..8befcf2c92735 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialAggregatorFunction.java @@ -82,7 +82,7 @@ public void evaluateIntermediate(Block[] blocks, int offset, DriverContext drive @Override public void evaluateFinal(Block[] blocks, int offset, DriverContext driverContext) { try (IntVector selected = outputPositions()) { - groupingAggregator.evaluateFinal(blocks, offset, selected, driverContext); + groupingAggregator.evaluateFinal(blocks, offset, selected, new GroupingAggregatorEvaluationContext(driverContext)); } } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialGroupingAggregatorFunction.java index 5c1a223404564..1706b8c023995 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/FromPartialGroupingAggregatorFunction.java @@ -13,7 +13,6 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; -import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.core.Releasables; import java.util.List; @@ -92,8 +91,8 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) } @Override - public void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) { - delegate.evaluateFinal(blocks, offset, selected, driverContext); + public void evaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) { + delegate.evaluateFinal(blocks, offset, selected, evaluationContext); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregator.java index 3612ca9996192..268ac3ba32678 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregator.java @@ -70,11 +70,11 @@ public void addIntermediateRow(int groupId, GroupingAggregator input, int positi * @param selected the groupIds that have been selected to be included in * the results. Always ascending. */ - public void evaluate(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) { + public void evaluate(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) { if (mode.isOutputPartial()) { aggregatorFunction.evaluateIntermediate(blocks, offset, selected); } else { - aggregatorFunction.evaluateFinal(blocks, offset, selected, driverContext); + aggregatorFunction.evaluateFinal(blocks, offset, selected, evaluationContext); } } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorEvaluationContext.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorEvaluationContext.java new file mode 100644 index 0000000000000..aac249612a746 --- /dev/null +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorEvaluationContext.java @@ -0,0 +1,31 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +package org.elasticsearch.compute.aggregation; + +import org.elasticsearch.compute.data.BlockFactory; +import org.elasticsearch.compute.operator.DriverContext; + +/** + * Provides a context for evaluating a grouping aggregator. + * A time-series aggregator might need more than just the DriverContext to evaluate, such as the range interval of each group. + */ +public class GroupingAggregatorEvaluationContext { + private final DriverContext driverContext; + + public GroupingAggregatorEvaluationContext(DriverContext driverContext) { + this.driverContext = driverContext; + } + + public DriverContext driverContext() { + return driverContext; + } + + public BlockFactory blockFactory() { + return driverContext.blockFactory(); + } +} diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunction.java index fbd2ddaa816b7..d5d432655620f 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunction.java @@ -12,7 +12,6 @@ import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.data.Vector; -import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.core.Releasable; /** @@ -114,7 +113,7 @@ interface AddInput extends Releasable { * @param selected the groupIds that have been selected to be included in * the results. Always ascending. */ - void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext); + void evaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext); /** The number of blocks used by intermediate state. */ int intermediateBlockCount(); diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/ToPartialGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/ToPartialGroupingAggregatorFunction.java index 18b907a3d7080..e0087a0ad2340 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/ToPartialGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/ToPartialGroupingAggregatorFunction.java @@ -12,7 +12,6 @@ import org.elasticsearch.compute.data.ElementType; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; -import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.core.Releasables; import java.util.List; @@ -95,7 +94,7 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) } @Override - public void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext) { + public void evaluateFinal(Block[] blocks, int offset, IntVector selected, GroupingAggregatorEvaluationContext evaluationContext) { evaluateIntermediate(blocks, offset, selected); } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st index a0b4ed8bd6337..e1c829eda4c2e 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/aggregation/X-RateAggregator.java.st @@ -36,7 +36,7 @@ import java.util.Arrays; * This class is generated. Edit `X-RateAggregator.java.st` instead. */ @GroupingAggregator( - includeTimestamps = true, + timeseries = true, value = { @IntermediateState(name = "timestamps", type = "LONG_BLOCK"), @IntermediateState(name = "values", type = "$TYPE$_BLOCK"), @@ -72,8 +72,12 @@ public class Rate$Type$Aggregator { current.combineState(currentGroupId, otherState, otherGroupId); } - public static Block evaluateFinal($Type$RateGroupingState state, IntVector selected, DriverContext driverContext) { - return state.evaluateFinal(selected, driverContext.blockFactory()); + public static Block evaluateFinal( + $Type$RateGroupingState state, + IntVector selected, + GroupingAggregatorEvaluationContext evaluatorContext + ) { + return state.evaluateFinal(selected, evaluatorContext.blockFactory()); } private static class $Type$RateState { diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/HashAggregationOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/HashAggregationOperator.java index c47b6cebdaddc..e40683948a966 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/HashAggregationOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/HashAggregationOperator.java @@ -16,6 +16,7 @@ import org.elasticsearch.compute.Describable; import org.elasticsearch.compute.aggregation.AggregatorMode; import org.elasticsearch.compute.aggregation.GroupingAggregator; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.blockhash.BlockHash; import org.elasticsearch.compute.data.Block; @@ -225,9 +226,10 @@ public void finish() { blocks = new Block[keys.length + Arrays.stream(aggBlockCounts).sum()]; System.arraycopy(keys, 0, blocks, 0, keys.length); int offset = keys.length; + var evaluationContext = new GroupingAggregatorEvaluationContext(driverContext); for (int i = 0; i < aggregators.size(); i++) { var aggregator = aggregators.get(i); - aggregator.evaluate(blocks, offset, selected, driverContext); + aggregator.evaluate(blocks, offset, selected, evaluationContext); offset += aggBlockCounts[i]; } output = new Page(blocks); diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/OrdinalsGroupingOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/OrdinalsGroupingOperator.java index 7cf47bc7fed1c..c030b329dd2d8 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/OrdinalsGroupingOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/OrdinalsGroupingOperator.java @@ -19,6 +19,7 @@ import org.elasticsearch.compute.Describable; import org.elasticsearch.compute.aggregation.GroupingAggregator; import org.elasticsearch.compute.aggregation.GroupingAggregator.Factory; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.SeenGroupIds; import org.elasticsearch.compute.aggregation.blockhash.BlockHash; @@ -292,7 +293,7 @@ protected boolean lessThan(AggregatedResultIterator a, AggregatedResultIterator try (IntVector selected = IntVector.range(0, blocks[0].getPositionCount(), driverContext.blockFactory())) { int offset = 1; for (int i = 0; i < aggregators.size(); i++) { - aggregators.get(i).evaluate(blocks, offset, selected, driverContext); + aggregators.get(i).evaluate(blocks, offset, selected, new GroupingAggregatorEvaluationContext(driverContext)); offset += aggBlockCounts[i]; } } diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunctionTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunctionTests.java index efe7fccd4f06a..dbd5d0cc167d1 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunctionTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/FilteredGroupingAggregatorFunctionTests.java @@ -133,8 +133,8 @@ public void testAddIntermediateRowInput() { } main.addIntermediateRowInput(0, leaf, 0); try (IntVector selected = ctx.blockFactory().newConstantIntVector(0, 1)) { - main.evaluateFinal(results, 0, selected, ctx); - leaf.evaluateFinal(results, 1, selected, ctx); + main.evaluateFinal(results, 0, selected, new GroupingAggregatorEvaluationContext(ctx)); + leaf.evaluateFinal(results, 1, selected, new GroupingAggregatorEvaluationContext(ctx)); } assertThat(results[0], equalTo(results[1])); } finally { diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunctionTestCase.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunctionTestCase.java index d82a8487b5390..0dccce6040e64 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunctionTestCase.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/aggregation/GroupingAggregatorFunctionTestCase.java @@ -733,8 +733,13 @@ public void evaluateIntermediate(Block[] blocks, int offset, IntVector selected) } @Override - public void evaluateFinal(Block[] blocks, int offset, IntVector selected, DriverContext driverContext1) { - delegate.evaluateFinal(blocks, offset, selected, driverContext); + public void evaluateFinal( + Block[] blocks, + int offset, + IntVector selected, + GroupingAggregatorEvaluationContext evaluationContext + ) { + delegate.evaluateFinal(blocks, offset, selected, evaluationContext); } @Override diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractAggregationTestCase.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractAggregationTestCase.java index f8ba9c1251088..b4bb0ce2045fb 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractAggregationTestCase.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractAggregationTestCase.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.aggregation.AggregatorFunctionSupplier; import org.elasticsearch.compute.aggregation.AggregatorMode; import org.elasticsearch.compute.aggregation.GroupingAggregator; +import org.elasticsearch.compute.aggregation.GroupingAggregatorEvaluationContext; import org.elasticsearch.compute.aggregation.GroupingAggregatorFunction; import org.elasticsearch.compute.aggregation.SeenGroupIds; import org.elasticsearch.compute.data.Block; @@ -354,7 +355,7 @@ private List extractResultsFromAggregator(GroupingAggregator aggregator, var resultBlockIndex = randomIntBetween(0, blocksArraySize - 1); var blocks = new Block[blocksArraySize]; try (var groups = IntVector.range(0, groupCount, driverContext().blockFactory())) { - aggregator.evaluate(blocks, resultBlockIndex, groups, driverContext()); + aggregator.evaluate(blocks, resultBlockIndex, groups, new GroupingAggregatorEvaluationContext(driverContext())); var block = blocks[resultBlockIndex];