From b5a27e075ebf33c977d2b3dc0aa03f0c1a2779e8 Mon Sep 17 00:00:00 2001 From: Jonas Kunz Date: Fri, 31 Oct 2025 14:25:31 +0100 Subject: [PATCH 1/4] Add exponential_histogram support in Evaluator and Aggregator code generation --- .../compute/gen/AggregatorImplementer.java | 58 ++++++++++++------- .../compute/gen/EvaluatorImplementer.java | 10 +++- .../gen/GroupingAggregatorImplementer.java | 54 ++++++++--------- .../elasticsearch/compute/gen/Methods.java | 3 + .../org/elasticsearch/compute/gen/Types.java | 43 +++++++++++--- .../compute/gen/argument/Argument.java | 16 +++-- .../compute/gen/argument/ArrayArgument.java | 13 +++-- .../gen/argument/StandardArgument.java | 7 +-- 8 files changed, 128 insertions(+), 76 deletions(-) diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java index 1327db4bc0bea..4bc9a6a42e7f0 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java @@ -37,6 +37,7 @@ import javax.lang.model.util.Elements; import static java.util.stream.Collectors.joining; +import static org.elasticsearch.compute.gen.Methods.getMethod; import static org.elasticsearch.compute.gen.Methods.optionalStaticMethod; import static org.elasticsearch.compute.gen.Methods.requireAnyArgs; import static org.elasticsearch.compute.gen.Methods.requireAnyType; @@ -53,7 +54,6 @@ import static org.elasticsearch.compute.gen.Types.BLOCK; import static org.elasticsearch.compute.gen.Types.BLOCK_ARRAY; import static org.elasticsearch.compute.gen.Types.BOOLEAN_VECTOR; -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.INTERMEDIATE_STATE_DESC; @@ -62,6 +62,8 @@ import static org.elasticsearch.compute.gen.Types.PAGE; import static org.elasticsearch.compute.gen.Types.WARNINGS; import static org.elasticsearch.compute.gen.Types.blockType; +import static org.elasticsearch.compute.gen.Types.fromString; +import static org.elasticsearch.compute.gen.Types.scratchType; import static org.elasticsearch.compute.gen.Types.vectorType; /** @@ -85,7 +87,7 @@ public class AggregatorImplementer { private final AggregationState aggState; private final List aggParams; - private final boolean hasOnlyBlockArguments; + private final boolean tryToUseVectors; public AggregatorImplementer( Elements elements, @@ -119,7 +121,8 @@ public AggregatorImplementer( return a; }).filter(a -> a instanceof PositionArgument == false).toList(); - this.hasOnlyBlockArguments = this.aggParams.stream().allMatch(a -> a instanceof BlockArgument); + this.tryToUseVectors = aggParams.stream().anyMatch(a -> (a instanceof BlockArgument) == false) + && aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.dataType(false) == null); this.createParameters = init.getParameters() .stream() @@ -199,7 +202,7 @@ private TypeSpec type() { builder.addMethod(addRawInput()); builder.addMethod(addRawInputExploded(true)); builder.addMethod(addRawInputExploded(false)); - if (hasOnlyBlockArguments == false) { + if (tryToUseVectors) { builder.addMethod(addRawVector(false)); builder.addMethod(addRawVector(true)); } @@ -340,16 +343,18 @@ private MethodSpec addRawInputExploded(boolean hasMask) { builder.addStatement("$T $L = page.getBlock(channels.get($L))", a.dataType(true), a.blockName(), i); } - for (Argument a : aggParams) { - String rawBlock = "addRawBlock(" - + aggParams.stream().map(arg -> arg.blockName()).collect(joining(", ")) - + (hasMask ? ", mask" : "") - + ")"; + if (tryToUseVectors) { + for (Argument a : aggParams) { + String rawBlock = "addRawBlock(" + + aggParams.stream().map(arg -> arg.blockName()).collect(joining(", ")) + + (hasMask ? ", mask" : "") + + ")"; - a.resolveVectors(builder, rawBlock, "return"); + a.resolveVectors(builder, rawBlock, "return"); + } } - builder.addStatement(invokeAddRaw(hasOnlyBlockArguments, hasMask)); + builder.addStatement(invokeAddRaw(tryToUseVectors == false, hasMask)); return builder.build(); } @@ -499,9 +504,9 @@ private MethodSpec.Builder initAddRaw(boolean blockStyle, boolean masked) { builder.addParameter(BOOLEAN_VECTOR, "mask"); } for (Argument a : aggParams) { - if (a.isBytesRef()) { - // Add bytes_ref scratch var that will be used for bytes_ref blocks/vectors - builder.addStatement("$T $L = new $T()", BYTES_REF, a.scratchName(), BYTES_REF); + if (a.scratchType() != null) { + // Add scratch var that will be used for some blocks/vectors, e.g. for bytes_ref + builder.addStatement("$T $L = new $T()", a.scratchType(), a.scratchName(), a.scratchType()); } } return builder; @@ -610,8 +615,8 @@ private MethodSpec addIntermediateInput() { ).map(Methods::requireType).toArray(TypeMatcher[]::new) ) ); - if (intermediateState.stream().map(IntermediateStateDesc::elementType).anyMatch(n -> n.equals("BYTES_REF"))) { - builder.addStatement("$T scratch = new $T()", BYTES_REF, BYTES_REF); + for (IntermediateStateDesc interState : intermediateState) { + interState.addScratchDeclaration(builder); } builder.addStatement("$T.combineIntermediate(state, " + intermediateStateRowAccess() + ")", declarationType); } @@ -706,13 +711,25 @@ public String access(String position) { if (block) { return name(); } - String s = name() + "." + vectorAccessorName(elementType()) + "(" + position; - if (elementType().equals("BYTES_REF")) { - s += ", scratch"; + String s = name() + "."; + if (vectorType(elementType) != null) { + s += vectorAccessorName(elementType()) + "(" + position; + } else { + s += getMethod(fromString(elementType())) + "(" + name() + ".getFirstValueIndex(" + position + ")"; + } + if (scratchType(elementType()) != null) { + s += ", " + name() + "Scratch"; } return s + ")"; } + public void addScratchDeclaration(MethodSpec.Builder builder) { + ClassName scratchType = scratchType(elementType()); + if (scratchType != null) { + builder.addStatement("$T $L = new $T()", scratchType, name() + "Scratch", scratchType); + } + } + public void assignToVariable(MethodSpec.Builder builder, int offset) { builder.addStatement("Block $L = page.getBlock(channels.get($L))", name + "Uncast", offset); ClassName blockType = blockType(elementType()); @@ -721,7 +738,7 @@ public void assignToVariable(MethodSpec.Builder builder, int offset) { builder.addStatement("return"); builder.endControlFlow(); } - if (block) { + if (block || vectorType(elementType) == null) { builder.addStatement("$T $L = ($T) $L", blockType, name, blockType, name + "Uncast"); } else { builder.addStatement("$T $L = (($T) $L).asVector()", vectorType(elementType), name, blockType, name + "Uncast"); @@ -732,6 +749,7 @@ public TypeName combineArgType() { var type = Types.fromString(elementType); return block ? blockType(type) : type; } + } /** diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java index bba578f45f5b0..f5d544fde7453 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java @@ -18,6 +18,7 @@ import org.elasticsearch.compute.gen.argument.BlockArgument; import org.elasticsearch.compute.gen.argument.BuilderArgument; import org.elasticsearch.compute.gen.argument.FixedArgument; +import org.elasticsearch.compute.gen.argument.PositionArgument; import java.util.ArrayList; import java.util.List; @@ -51,6 +52,7 @@ public class EvaluatorImplementer { private final ProcessFunction processFunction; private final ClassName implementation; private final boolean processOutputsMultivalued; + private final boolean vectorsUnsupported; private final boolean allNullsIsNull; public EvaluatorImplementer( @@ -69,6 +71,10 @@ public EvaluatorImplementer( declarationType.getSimpleName() + extraName + "Evaluator" ); this.processOutputsMultivalued = this.processFunction.hasBlockType; + boolean anyParameterNotSupportingVectors = this.processFunction.args.stream() + .filter(a -> a instanceof FixedArgument == false && a instanceof PositionArgument == false) + .anyMatch(a -> a.dataType(false) == null); + vectorsUnsupported = processOutputsMultivalued || anyParameterNotSupportingVectors; this.allNullsIsNull = allNullsIsNull; } @@ -101,7 +107,7 @@ private TypeSpec type() { builder.addMethod(eval()); builder.addMethod(processFunction.baseRamBytesUsed()); - if (processOutputsMultivalued) { + if (vectorsUnsupported) { if (processFunction.args.stream().anyMatch(x -> x instanceof FixedArgument == false)) { builder.addMethod(realEval(true)); } @@ -145,7 +151,7 @@ private MethodSpec eval() { builder.addModifiers(Modifier.PUBLIC).returns(BLOCK).addParameter(PAGE, "page"); processFunction.args.forEach(a -> a.evalToBlock(builder)); String invokeBlockEval = invokeRealEval(true); - if (processOutputsMultivalued) { + if (vectorsUnsupported) { builder.addStatement(invokeBlockEval); } else { processFunction.args.forEach(a -> a.resolveVectors(builder, invokeBlockEval)); 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 399f45b5df667..c2ed5f463913e 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 @@ -51,7 +51,6 @@ import static org.elasticsearch.compute.gen.Types.BIG_ARRAYS; import static org.elasticsearch.compute.gen.Types.BLOCK; import static org.elasticsearch.compute.gen.Types.BLOCK_ARRAY; -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; @@ -93,6 +92,7 @@ public class GroupingAggregatorImplementer { private final AggregationState aggState; private final List aggParams; private final boolean hasOnlyBlockArguments; + private final boolean allArgumentsSupportVectors; public GroupingAggregatorImplementer( Elements elements, @@ -128,6 +128,7 @@ public GroupingAggregatorImplementer( }).filter(a -> a instanceof PositionArgument == false).toList(); this.hasOnlyBlockArguments = this.aggParams.stream().allMatch(a -> a instanceof BlockArgument); + this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.dataType(false) == null); this.createParameters = init.getParameters() .stream() @@ -204,7 +205,7 @@ private TypeSpec type() { builder.addMethod(prepareProcessRawInputPage()); for (ClassName groupIdClass : GROUP_IDS_CLASSES) { builder.addMethod(addRawInputLoop(groupIdClass, false)); - if (hasOnlyBlockArguments == false) { + if (hasOnlyBlockArguments == false && allArgumentsSupportVectors) { builder.addMethod(addRawInputLoop(groupIdClass, true)); } builder.addMethod(addIntermediateInput(groupIdClass)); @@ -330,26 +331,31 @@ private MethodSpec prepareProcessRawInputPage() { builder.addStatement("$T $L = page.getBlock(channels.get($L))", a.dataType(true), a.blockName(), i); } - for (Argument a : aggParams) { - builder.addStatement( - "$T $L = $L.asVector()", - vectorType(a.elementType()), - (a instanceof BlockArgument) ? (a.name() + "Vector") : a.vectorName(), - a.blockName() - ); - builder.beginControlFlow("if ($L == null)", (a instanceof BlockArgument) ? (a.name() + "Vector") : a.vectorName()); - { + String groupIdTrackingStatement = "maybeEnableGroupIdTracking(seenGroupIds, " + + aggParams.stream().map(arg -> arg.blockName()).collect(joining(", ")) + + ")"; + + if (allArgumentsSupportVectors) { + + for (Argument a : aggParams) { builder.addStatement( - "maybeEnableGroupIdTracking(seenGroupIds, " - + aggParams.stream().map(arg -> arg.blockName()).collect(joining(", ")) - + ")" + "$T $L = $L.asVector()", + vectorType(a.elementType()), + (a instanceof BlockArgument) ? (a.name() + "Vector") : a.vectorName(), + a.blockName() ); - returnAddInput(builder, false); + builder.beginControlFlow("if ($L == null)", (a instanceof BlockArgument) ? (a.name() + "Vector") : a.vectorName()); + { + builder.addStatement(groupIdTrackingStatement); + returnAddInput(builder, false); + } + builder.endControlFlow(); } - builder.endControlFlow(); + returnAddInput(builder, true); + } else { + builder.addStatement(groupIdTrackingStatement); + returnAddInput(builder, false); } - - returnAddInput(builder, true); return builder.build(); } @@ -443,9 +449,9 @@ private MethodSpec addRawInputLoop(TypeName groupsType, boolean valuesAreVector) ); } for (Argument a : aggParams) { - if (a.isBytesRef()) { - // Add bytes_ref scratch var that will be used for bytes_ref blocks/vectors - builder.addStatement("$T $L = new $T()", BYTES_REF, a.scratchName(), BYTES_REF); + if (a.scratchType() != null) { + // Add scratch var that will be used for some blocks/vectors, e.g. for bytes_ref + builder.addStatement("$T $L = new $T()", a.scratchType(), a.scratchName(), a.scratchType()); } } @@ -645,11 +651,7 @@ private MethodSpec addIntermediateInput(TypeName groupsType) { .collect(Collectors.joining(", ")); builder.addStatement("$T.combineIntermediate(state, positionOffset, groups, " + states + ")", declarationType); } else { - if (intermediateState.stream() - .map(AggregatorImplementer.IntermediateStateDesc::elementType) - .anyMatch(n -> n.equals("BYTES_REF"))) { - builder.addStatement("$T scratch = new $T()", BYTES_REF, BYTES_REF); - } + intermediateState.forEach(state -> state.addScratchDeclaration(builder)); builder.beginControlFlow("for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++)"); { if (groupsIsBlock) { diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Methods.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Methods.java index 15520c6ed93ab..2a06777c62d6e 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Methods.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Methods.java @@ -314,6 +314,9 @@ public static String getMethod(TypeName elementType) { if (elementType.equals(TypeName.FLOAT)) { return "getFloat"; } + if (elementType.equals(Types.EXPONENTIAL_HISTOGRAM)) { + return "getExponentialHistogram"; + } throw new IllegalArgumentException("unknown get method for [" + elementType + "]"); } 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 82b3450343ced..d31679665efb5 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 @@ -52,6 +52,8 @@ public class Types { public static final ClassName LONG_BLOCK = ClassName.get(DATA_PACKAGE, "LongBlock"); public static final ClassName DOUBLE_BLOCK = ClassName.get(DATA_PACKAGE, "DoubleBlock"); public static final ClassName FLOAT_BLOCK = ClassName.get(DATA_PACKAGE, "FloatBlock"); + public static final ClassName EXPONENTIAL_HISTOGRAM_BLOCK = ClassName.get(DATA_PACKAGE, "ExponentialHistogramBlock"); + public static final ClassName EXPONENTIAL_HISTOGRAM_SCRATCH = ClassName.get(DATA_PACKAGE, "ExponentialHistogramScratch"); static final ClassName BOOLEAN_BLOCK_BUILDER = BOOLEAN_BLOCK.nestedClass("Builder"); static final ClassName BYTES_REF_BLOCK_BUILDER = BYTES_REF_BLOCK.nestedClass("Builder"); @@ -59,6 +61,7 @@ public class Types { static final ClassName LONG_BLOCK_BUILDER = LONG_BLOCK.nestedClass("Builder"); static final ClassName DOUBLE_BLOCK_BUILDER = DOUBLE_BLOCK.nestedClass("Builder"); static final ClassName FLOAT_BLOCK_BUILDER = FLOAT_BLOCK.nestedClass("Builder"); + static final ClassName EXPONENTIAL_HISTOGRAM_BLOCK_BUILDER = ClassName.get(DATA_PACKAGE, "ExponentialHistogramBlockBuilder"); static final ClassName ELEMENT_TYPE = ClassName.get(DATA_PACKAGE, "ElementType"); @@ -133,24 +136,32 @@ public class Types { static final ClassName SOURCE = ClassName.get("org.elasticsearch.xpack.esql.core.tree", "Source"); public static final ClassName BYTES_REF = ClassName.get("org.apache.lucene.util", "BytesRef"); + public static final ClassName EXPONENTIAL_HISTOGRAM = ClassName.get("org.elasticsearch.exponentialhistogram", "ExponentialHistogram"); public static final ClassName RELEASABLE = ClassName.get("org.elasticsearch.core", "Releasable"); public static final ClassName RELEASABLES = ClassName.get("org.elasticsearch.core", "Releasables"); - private record TypeDef(TypeName type, String alias, ClassName block, ClassName vector) { + private record TypeDef(TypeName type, String alias, ClassName block, ClassName vector, ClassName scratch) { - public static TypeDef of(TypeName type, String alias, String block, String vector) { - return new TypeDef(type, alias, ClassName.get(DATA_PACKAGE, block), ClassName.get(DATA_PACKAGE, vector)); + public static TypeDef of(TypeName type, String alias, String block, String vector, ClassName scratch) { + return new TypeDef( + type, + alias, + ClassName.get(DATA_PACKAGE, block), + vector == null ? null : ClassName.get(DATA_PACKAGE, vector), + scratch + ); } } private static final Map TYPES = Stream.of( - TypeDef.of(TypeName.BOOLEAN, "BOOLEAN", "BooleanBlock", "BooleanVector"), - TypeDef.of(TypeName.INT, "INT", "IntBlock", "IntVector"), - TypeDef.of(TypeName.LONG, "LONG", "LongBlock", "LongVector"), - TypeDef.of(TypeName.FLOAT, "FLOAT", "FloatBlock", "FloatVector"), - TypeDef.of(TypeName.DOUBLE, "DOUBLE", "DoubleBlock", "DoubleVector"), - TypeDef.of(BYTES_REF, "BYTES_REF", "BytesRefBlock", "BytesRefVector") + TypeDef.of(TypeName.BOOLEAN, "BOOLEAN", "BooleanBlock", "BooleanVector", null), + TypeDef.of(TypeName.INT, "INT", "IntBlock", "IntVector", null), + TypeDef.of(TypeName.LONG, "LONG", "LongBlock", "LongVector", null), + TypeDef.of(TypeName.FLOAT, "FLOAT", "FloatBlock", "FloatVector", null), + TypeDef.of(TypeName.DOUBLE, "DOUBLE", "DoubleBlock", "DoubleVector", null), + TypeDef.of(BYTES_REF, "BYTES_REF", "BytesRefBlock", "BytesRefVector", BYTES_REF), + TypeDef.of(EXPONENTIAL_HISTOGRAM, "EXPONENTIAL_HISTOGRAM", "ExponentialHistogramBlock", null, EXPONENTIAL_HISTOGRAM_SCRATCH) ) .flatMap(def -> Stream.of(def.type.toString(), def.type + "[]", def.alias).map(alias -> Map.entry(alias, def))) .collect(toUnmodifiableMap(Map.Entry::getKey, Map.Entry::getValue)); @@ -183,6 +194,14 @@ static ClassName vectorType(String elementType) { return findRequired(elementType, "vector").vector; } + public static ClassName scratchType(String elementType) { + TypeDef typeDef = TYPES.get(elementType); + if (typeDef != null) { + return typeDef.scratch; + } + return null; + } + static ClassName builderType(TypeName resultType) { if (resultType.equals(BOOLEAN_BLOCK)) { return BOOLEAN_BLOCK_BUILDER; @@ -220,6 +239,9 @@ static ClassName builderType(TypeName resultType) { if (resultType.equals(FLOAT_VECTOR)) { return FLOAT_VECTOR_BUILDER; } + if (resultType.equals(EXPONENTIAL_HISTOGRAM_BLOCK)) { + return EXPONENTIAL_HISTOGRAM_BLOCK_BUILDER; + } throw new IllegalArgumentException("unknown builder type for [" + resultType + "]"); } @@ -261,6 +283,9 @@ public static TypeName elementType(TypeName t) { if (t.equals(FLOAT_BLOCK) || t.equals(FLOAT_VECTOR) || t.equals(FLOAT_BLOCK_BUILDER)) { return TypeName.FLOAT; } + if (t.equals(EXPONENTIAL_HISTOGRAM_BLOCK) || t.equals(EXPONENTIAL_HISTOGRAM_BLOCK_BUILDER)) { + return EXPONENTIAL_HISTOGRAM; + } throw new IllegalArgumentException("unknown element type for [" + t + "]"); } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java index 4a2100a177e92..16eb9d851f100 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java @@ -17,7 +17,6 @@ import org.elasticsearch.compute.gen.Types; import java.util.List; -import java.util.Objects; import javax.lang.model.element.VariableElement; import javax.lang.model.type.ArrayType; @@ -25,7 +24,6 @@ import javax.lang.model.type.TypeMirror; import static org.elasticsearch.compute.gen.Methods.getMethod; -import static org.elasticsearch.compute.gen.Types.BYTES_REF; import static org.elasticsearch.compute.gen.Types.blockType; import static org.elasticsearch.compute.gen.Types.vectorType; import static org.elasticsearch.compute.gen.argument.StandardArgument.isBlockType; @@ -93,18 +91,18 @@ default String offsetName() { return name() + "Offset"; } + default ClassName scratchType() { + return Types.scratchType(type().toString()); + } + default String scratchName() { - if (isBytesRef() == false) { - throw new IllegalStateException("can't build scratch for non-BytesRef"); + if (scratchType() == null) { + throw new IllegalStateException("can't build scratch for " + type()); } return name() + "Scratch"; } - default boolean isBytesRef() { - return Objects.equals(type(), BYTES_REF); - } - String name(); TypeName type(); @@ -198,7 +196,7 @@ default TypeName elementType() { */ default void read(MethodSpec.Builder builder, String accessor, String firstParam) { String params = firstParam; - if (isBytesRef()) { + if (scratchType() != null) { params += ", " + scratchName(); } builder.addStatement("$T $L = $L.$L($L)", type(), valueName(), accessor, getMethod(type()), params); diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java index 0ee2bf1998a74..d20296bf7f6db 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java @@ -8,6 +8,7 @@ package org.elasticsearch.compute.gen.argument; import com.squareup.javapoet.ArrayTypeName; +import com.squareup.javapoet.ClassName; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; @@ -18,7 +19,6 @@ import javax.lang.model.element.Modifier; import static org.elasticsearch.compute.gen.Methods.getMethod; -import static org.elasticsearch.compute.gen.Types.BYTES_REF; import static org.elasticsearch.compute.gen.Types.EXPRESSION_EVALUATOR; import static org.elasticsearch.compute.gen.Types.EXPRESSION_EVALUATOR_FACTORY; import static org.elasticsearch.compute.gen.Types.RELEASABLE; @@ -105,10 +105,11 @@ public void resolveVectors(MethodSpec.Builder builder, String... invokeBlockEval @Override public void createScratch(MethodSpec.Builder builder) { builder.addStatement("$T[] $LValues = new $T[$L.length]", type, name, type, name); - if (isBytesRef()) { - builder.addStatement("$T[] $LScratch = new $T[$L.length]", type, name, type, name); + ClassName scratchType = scratchType(); + if (scratchType != null) { + builder.addStatement("$T[] $LScratch = new $T[$L.length]", scratchType, name, scratchType, name); builder.beginControlFlow("for (int i = 0; i < $L.length; i++)", name); - builder.addStatement("$LScratch[i] = new $T()", name, BYTES_REF); + builder.addStatement("$LScratch[i] = new $T()", name, scratchType); builder.endControlFlow(); } } @@ -136,8 +137,8 @@ public void read(MethodSpec.Builder builder, boolean blockStyle) { } else { lookupVar = "p"; } - if (isBytesRef()) { - builder.addStatement("$LValues[i] = $L[i].getBytesRef($L, $LScratch[i])", name, paramName(blockStyle), lookupVar, name); + if (scratchType() != null) { + builder.addStatement("$LValues[i] = $L[i].$L($L, $LScratch[i])", name, paramName(blockStyle), getMethod(type), lookupVar, name); } else { builder.addStatement("$LValues[i] = $L[i].$L($L)", name, paramName(blockStyle), getMethod(type), lookupVar); } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java index 981e3de3f22f4..12b8ca98165bc 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java @@ -17,7 +17,6 @@ import static org.elasticsearch.compute.gen.Methods.getMethod; import static org.elasticsearch.compute.gen.Types.BOOLEAN_BLOCK; -import static org.elasticsearch.compute.gen.Types.BYTES_REF; import static org.elasticsearch.compute.gen.Types.BYTES_REF_BLOCK; import static org.elasticsearch.compute.gen.Types.DOUBLE_BLOCK; import static org.elasticsearch.compute.gen.Types.EXPRESSION_EVALUATOR; @@ -93,8 +92,8 @@ public void resolveVectors(MethodSpec.Builder builder, String... invokeBlockEval @Override public void createScratch(MethodSpec.Builder builder) { - if (isBytesRef()) { - builder.addStatement("$T $LScratch = new $T()", BYTES_REF, name, BYTES_REF); + if (scratchType() != null) { + builder.addStatement("$T $LScratch = new $T()", scratchType(), name, scratchType()); } } @@ -123,7 +122,7 @@ static boolean isBlockType(TypeName type) { @Override public void read(MethodSpec.Builder builder, boolean blockStyle) { String params = blockStyle ? paramName(true) + ".getFirstValueIndex(p)" : "p"; - if (isBytesRef()) { + if (scratchType() != null) { params += ", " + scratchName(); } builder.addStatement("$T $L = $L.$L($L)", type, name, paramName(blockStyle), getMethod(type), params); From 546610773837ae564a1c1ba202e3c50250552743 Mon Sep 17 00:00:00 2001 From: Jonas Kunz Date: Fri, 31 Oct 2025 14:59:51 +0100 Subject: [PATCH 2/4] Generate code --- .../CountDistinctBytesRefAggregatorFunction.java | 4 ++-- ...ntDistinctBytesRefGroupingAggregatorFunction.java | 12 ++++++------ .../CountDistinctDoubleAggregatorFunction.java | 4 ++-- ...ountDistinctDoubleGroupingAggregatorFunction.java | 12 ++++++------ .../CountDistinctFloatAggregatorFunction.java | 4 ++-- ...CountDistinctFloatGroupingAggregatorFunction.java | 12 ++++++------ .../CountDistinctIntAggregatorFunction.java | 4 ++-- .../CountDistinctIntGroupingAggregatorFunction.java | 12 ++++++------ .../CountDistinctLongAggregatorFunction.java | 4 ++-- .../CountDistinctLongGroupingAggregatorFunction.java | 12 ++++++------ .../FirstBytesRefByTimestampAggregatorFunction.java | 4 ++-- ...ytesRefByTimestampGroupingAggregatorFunction.java | 6 +++--- .../LastBytesRefByTimestampAggregatorFunction.java | 4 ++-- ...ytesRefByTimestampGroupingAggregatorFunction.java | 6 +++--- .../aggregation/MaxBytesRefAggregatorFunction.java | 4 ++-- .../MaxBytesRefGroupingAggregatorFunction.java | 12 ++++++------ .../compute/aggregation/MaxIpAggregatorFunction.java | 4 ++-- .../aggregation/MaxIpGroupingAggregatorFunction.java | 12 ++++++------ ...ianAbsoluteDeviationDoubleAggregatorFunction.java | 4 ++-- ...uteDeviationDoubleGroupingAggregatorFunction.java | 12 ++++++------ ...dianAbsoluteDeviationFloatAggregatorFunction.java | 4 ++-- ...luteDeviationFloatGroupingAggregatorFunction.java | 12 ++++++------ ...MedianAbsoluteDeviationIntAggregatorFunction.java | 4 ++-- ...soluteDeviationIntGroupingAggregatorFunction.java | 12 ++++++------ ...edianAbsoluteDeviationLongAggregatorFunction.java | 4 ++-- ...oluteDeviationLongGroupingAggregatorFunction.java | 12 ++++++------ .../aggregation/MinBytesRefAggregatorFunction.java | 4 ++-- .../MinBytesRefGroupingAggregatorFunction.java | 12 ++++++------ .../compute/aggregation/MinIpAggregatorFunction.java | 4 ++-- .../aggregation/MinIpGroupingAggregatorFunction.java | 12 ++++++------ .../PercentileDoubleAggregatorFunction.java | 4 ++-- .../PercentileDoubleGroupingAggregatorFunction.java | 12 ++++++------ .../PercentileFloatAggregatorFunction.java | 4 ++-- .../PercentileFloatGroupingAggregatorFunction.java | 12 ++++++------ .../aggregation/PercentileIntAggregatorFunction.java | 4 ++-- .../PercentileIntGroupingAggregatorFunction.java | 12 ++++++------ .../PercentileLongAggregatorFunction.java | 4 ++-- .../PercentileLongGroupingAggregatorFunction.java | 12 ++++++------ .../aggregation/SampleBooleanAggregatorFunction.java | 2 +- .../SampleBooleanGroupingAggregatorFunction.java | 6 +++--- .../SampleBytesRefAggregatorFunction.java | 2 +- .../SampleBytesRefGroupingAggregatorFunction.java | 6 +++--- .../aggregation/SampleDoubleAggregatorFunction.java | 2 +- .../SampleDoubleGroupingAggregatorFunction.java | 6 +++--- .../aggregation/SampleIntAggregatorFunction.java | 2 +- .../SampleIntGroupingAggregatorFunction.java | 6 +++--- .../aggregation/SampleLongAggregatorFunction.java | 2 +- .../SampleLongGroupingAggregatorFunction.java | 6 +++--- .../aggregation/TopBytesRefAggregatorFunction.java | 2 +- .../TopBytesRefGroupingAggregatorFunction.java | 6 +++--- .../compute/aggregation/TopIpAggregatorFunction.java | 2 +- .../aggregation/TopIpGroupingAggregatorFunction.java | 6 +++--- .../ValuesBytesRefAggregatorFunction.java | 2 +- 53 files changed, 175 insertions(+), 175 deletions(-) diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefAggregatorFunction.java index 71a3ec03278eb..b9737cc15976a 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctBytesRefAggregatorFunction.java @@ -151,8 +151,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); assert hll.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - CountDistinctBytesRefAggregator.combineIntermediate(state, hll.getBytesRef(0, scratch)); + BytesRef hllScratch = new BytesRef(); + CountDistinctBytesRefAggregator.combineIntermediate(state, hll.getBytesRef(0, hllScratch)); } @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 1abea90e89ee3..8c11792fa4f4e 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctBytesRefAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctBytesRefAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -223,7 +223,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -233,7 +233,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctBytesRefAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctBytesRefAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -274,11 +274,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - CountDistinctBytesRefAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctBytesRefAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleAggregatorFunction.java index 68d7270a49d0b..c791c3fd11b7a 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctDoubleAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); assert hll.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - CountDistinctDoubleAggregator.combineIntermediate(state, hll.getBytesRef(0, scratch)); + BytesRef hllScratch = new BytesRef(); + CountDistinctDoubleAggregator.combineIntermediate(state, hll.getBytesRef(0, hllScratch)); } @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 c839f787c991f..3520b9f53f4c9 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctDoubleAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctDoubleAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -221,7 +221,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -231,7 +231,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctDoubleAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctDoubleAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -270,11 +270,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - CountDistinctDoubleAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctDoubleAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatAggregatorFunction.java index c01c34887cf4e..06068bf343978 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctFloatAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); assert hll.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - CountDistinctFloatAggregator.combineIntermediate(state, hll.getBytesRef(0, scratch)); + BytesRef hllScratch = new BytesRef(); + CountDistinctFloatAggregator.combineIntermediate(state, hll.getBytesRef(0, hllScratch)); } @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 a8f284f7e8fdc..4a000e848c73b 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctFloatAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctFloatAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -221,7 +221,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -231,7 +231,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctFloatAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctFloatAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -270,11 +270,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - CountDistinctFloatAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctFloatAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntAggregatorFunction.java index 25a82171c54e4..1d378d7d8bb06 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctIntAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); assert hll.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - CountDistinctIntAggregator.combineIntermediate(state, hll.getBytesRef(0, scratch)); + BytesRef hllScratch = new BytesRef(); + CountDistinctIntAggregator.combineIntermediate(state, hll.getBytesRef(0, hllScratch)); } @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 ad7e329d8ea7d..5320bff130fa5 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 @@ -157,7 +157,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -167,7 +167,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctIntAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctIntAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -220,7 +220,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -230,7 +230,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctIntAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctIntAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -269,11 +269,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - CountDistinctIntAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctIntAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongAggregatorFunction.java index 34c5b2ee2bda5..88ddb7261f378 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/CountDistinctLongAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); assert hll.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - CountDistinctLongAggregator.combineIntermediate(state, hll.getBytesRef(0, scratch)); + BytesRef hllScratch = new BytesRef(); + CountDistinctLongAggregator.combineIntermediate(state, hll.getBytesRef(0, hllScratch)); } @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 8bdff2e73ebb9..5a76c5440615c 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctLongAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctLongAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -221,7 +221,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -231,7 +231,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - CountDistinctLongAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctLongAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } } @@ -270,11 +270,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector hll = ((BytesRefBlock) hllUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef hllScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - CountDistinctLongAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, scratch)); + CountDistinctLongAggregator.combineIntermediate(state, groupId, hll.getBytesRef(valuesPosition, hllScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampAggregatorFunction.java index eb88ed39323d2..91822de9973aa 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampAggregatorFunction.java @@ -237,8 +237,8 @@ public void addIntermediateInput(Page page) { } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert seen.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - FirstBytesRefByTimestampAggregator.combineIntermediate(state, timestamps.getLong(0), values.getBytesRef(0, scratch), seen.getBoolean(0)); + BytesRef valuesScratch = new BytesRef(); + FirstBytesRefByTimestampAggregator.combineIntermediate(state, timestamps.getLong(0), values.getBytesRef(0, valuesScratch), seen.getBoolean(0)); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampGroupingAggregatorFunction.java index aee8d6296dc02..42b016f4580d8 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/FirstBytesRefByTimestampGroupingAggregatorFunction.java @@ -200,7 +200,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert timestamps.getPositionCount() == values.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -282,7 +282,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert timestamps.getPositionCount() == values.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -350,7 +350,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert timestamps.getPositionCount() == values.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampAggregatorFunction.java index 0233a00ccd45f..70b05e5ae2910 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampAggregatorFunction.java @@ -237,8 +237,8 @@ public void addIntermediateInput(Page page) { } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert seen.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - LastBytesRefByTimestampAggregator.combineIntermediate(state, timestamps.getLong(0), values.getBytesRef(0, scratch), seen.getBoolean(0)); + BytesRef valuesScratch = new BytesRef(); + LastBytesRefByTimestampAggregator.combineIntermediate(state, timestamps.getLong(0), values.getBytesRef(0, valuesScratch), seen.getBoolean(0)); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampGroupingAggregatorFunction.java index c5ee2afaf04c7..4ee67fdbdb818 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/LastBytesRefByTimestampGroupingAggregatorFunction.java @@ -200,7 +200,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert timestamps.getPositionCount() == values.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -282,7 +282,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert timestamps.getPositionCount() == values.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -350,7 +350,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert timestamps.getPositionCount() == values.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefAggregatorFunction.java index 80810713866ce..e606864ba63f4 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxBytesRefAggregatorFunction.java @@ -156,8 +156,8 @@ public void addIntermediateInput(Page page) { } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert seen.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MaxBytesRefAggregator.combineIntermediate(state, max.getBytesRef(0, scratch), seen.getBoolean(0)); + BytesRef maxScratch = new BytesRef(); + MaxBytesRefAggregator.combineIntermediate(state, max.getBytesRef(0, maxScratch), seen.getBoolean(0)); } @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 793570db726a9..ab162190fa43d 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 @@ -164,7 +164,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -174,7 +174,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MaxBytesRefAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MaxBytesRefAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } } @@ -236,7 +236,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -246,7 +246,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MaxBytesRefAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MaxBytesRefAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } } @@ -293,11 +293,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MaxBytesRefAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MaxBytesRefAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpAggregatorFunction.java index d192718d14e10..119cdb5917c06 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MaxIpAggregatorFunction.java @@ -156,8 +156,8 @@ public void addIntermediateInput(Page page) { } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert seen.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MaxIpAggregator.combineIntermediate(state, max.getBytesRef(0, scratch), seen.getBoolean(0)); + BytesRef maxScratch = new BytesRef(); + MaxIpAggregator.combineIntermediate(state, max.getBytesRef(0, maxScratch), seen.getBoolean(0)); } @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 bfee9d26f3996..5de02faac858a 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 @@ -164,7 +164,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -174,7 +174,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MaxIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MaxIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } } @@ -236,7 +236,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -246,7 +246,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MaxIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MaxIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } } @@ -293,11 +293,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MaxIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MaxIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleAggregatorFunction.java index 6c50628613ae1..43b4170f68d53 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationDoubleAggregatorFunction.java @@ -146,8 +146,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 3fd6a54970645..27531cb01ea14 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 @@ -155,7 +155,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -165,7 +165,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -218,7 +218,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -228,7 +228,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -267,11 +267,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatAggregatorFunction.java index 7efedf93a8910..27a580e1da6f7 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationFloatAggregatorFunction.java @@ -146,8 +146,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 c706d6a68b9ad..2f57442e14ea6 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 @@ -155,7 +155,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -165,7 +165,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -218,7 +218,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -228,7 +228,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -267,11 +267,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntAggregatorFunction.java index 73756681f5c18..68c9d8ce75174 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationIntAggregatorFunction.java @@ -146,8 +146,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 171e4238f68c7..6f6e711157a80 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 @@ -154,7 +154,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -164,7 +164,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -217,7 +217,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -227,7 +227,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -266,11 +266,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongAggregatorFunction.java index 4c6afaba77234..8f71e4cc249b9 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MedianAbsoluteDeviationLongAggregatorFunction.java @@ -146,8 +146,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 2136c8d0fd1fd..3a75aa3ba2e73 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 @@ -155,7 +155,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -165,7 +165,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -218,7 +218,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -228,7 +228,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -267,11 +267,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + MedianAbsoluteDeviationLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefAggregatorFunction.java index 92660be1185a0..a7ab1814d670d 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinBytesRefAggregatorFunction.java @@ -156,8 +156,8 @@ public void addIntermediateInput(Page page) { } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert seen.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MinBytesRefAggregator.combineIntermediate(state, min.getBytesRef(0, scratch), seen.getBoolean(0)); + BytesRef minScratch = new BytesRef(); + MinBytesRefAggregator.combineIntermediate(state, min.getBytesRef(0, minScratch), seen.getBoolean(0)); } @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 e3acfe1ab1943..03e07ad54cb1f 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 @@ -164,7 +164,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert min.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef minScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -174,7 +174,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MinBytesRefAggregator.combineIntermediate(state, groupId, min.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MinBytesRefAggregator.combineIntermediate(state, groupId, min.getBytesRef(valuesPosition, minScratch), seen.getBoolean(valuesPosition)); } } } @@ -236,7 +236,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert min.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef minScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -246,7 +246,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MinBytesRefAggregator.combineIntermediate(state, groupId, min.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MinBytesRefAggregator.combineIntermediate(state, groupId, min.getBytesRef(valuesPosition, minScratch), seen.getBoolean(valuesPosition)); } } } @@ -293,11 +293,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert min.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef minScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MinBytesRefAggregator.combineIntermediate(state, groupId, min.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MinBytesRefAggregator.combineIntermediate(state, groupId, min.getBytesRef(valuesPosition, minScratch), seen.getBoolean(valuesPosition)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpAggregatorFunction.java index db61c405d440e..61898ca139071 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/MinIpAggregatorFunction.java @@ -156,8 +156,8 @@ public void addIntermediateInput(Page page) { } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert seen.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - MinIpAggregator.combineIntermediate(state, max.getBytesRef(0, scratch), seen.getBoolean(0)); + BytesRef maxScratch = new BytesRef(); + MinIpAggregator.combineIntermediate(state, max.getBytesRef(0, maxScratch), seen.getBoolean(0)); } @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 69b3c227a2dab..ea678434b7dbb 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 @@ -164,7 +164,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -174,7 +174,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MinIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MinIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } } @@ -236,7 +236,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -246,7 +246,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - MinIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MinIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } } @@ -293,11 +293,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page } BooleanVector seen = ((BooleanBlock) seenUncast).asVector(); assert max.getPositionCount() == seen.getPositionCount(); - BytesRef scratch = new BytesRef(); + BytesRef maxScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - MinIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, scratch), seen.getBoolean(valuesPosition)); + MinIpAggregator.combineIntermediate(state, groupId, max.getBytesRef(valuesPosition, maxScratch), seen.getBoolean(valuesPosition)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleAggregatorFunction.java index 7ae73ed7e1eb9..48a54247588d3 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileDoubleAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - PercentileDoubleAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + PercentileDoubleAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 f726423df4d4d..81e2d2189e133 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -221,7 +221,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -231,7 +231,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -270,11 +270,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - PercentileDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileDoubleAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatAggregatorFunction.java index 29acca005738d..5b172e43a7cfe 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileFloatAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - PercentileFloatAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + PercentileFloatAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 b5be9cc7655bd..c5cf407d86dc0 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -221,7 +221,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -231,7 +231,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -270,11 +270,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - PercentileFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileFloatAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntAggregatorFunction.java index 21784c215f3f6..081120592aebd 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileIntAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - PercentileIntAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + PercentileIntAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 c94cc37109e4e..a278b28d1d317 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 @@ -157,7 +157,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -167,7 +167,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -220,7 +220,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -230,7 +230,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -269,11 +269,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - PercentileIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileIntAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongAggregatorFunction.java index df49223605ec2..6d81e228ca662 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/PercentileLongAggregatorFunction.java @@ -149,8 +149,8 @@ public void addIntermediateInput(Page page) { } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); assert quart.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); - PercentileLongAggregator.combineIntermediate(state, quart.getBytesRef(0, scratch)); + BytesRef quartScratch = new BytesRef(); + PercentileLongAggregator.combineIntermediate(state, quart.getBytesRef(0, quartScratch)); } @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 d48770a77abf2..2f22604be77c4 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 @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -168,7 +168,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -221,7 +221,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -231,7 +231,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa for (int g = groupStart; g < groupEnd; g++) { int groupId = groups.getInt(g); int valuesPosition = groupPosition + positionOffset; - PercentileLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } } @@ -270,11 +270,11 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefVector quart = ((BytesRefBlock) quartUncast).asVector(); - BytesRef scratch = new BytesRef(); + BytesRef quartScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; - PercentileLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, scratch)); + PercentileLongAggregator.combineIntermediate(state, groupId, quart.getBytesRef(valuesPosition, quartScratch)); } } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanAggregatorFunction.java index a5cfcbb1e03e2..9ce0bffb4e642 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanAggregatorFunction.java @@ -147,7 +147,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock sample = (BytesRefBlock) sampleUncast; assert sample.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); SampleBooleanAggregator.combineIntermediate(state, sample); } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanGroupingAggregatorFunction.java index c675030a16bf2..c2d86ef1a9e54 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBooleanGroupingAggregatorFunction.java @@ -157,7 +157,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -220,7 +220,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -269,7 +269,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefAggregatorFunction.java index 45e55a2f9a5a3..dc3af45e9bec2 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefAggregatorFunction.java @@ -151,7 +151,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock sample = (BytesRefBlock) sampleUncast; assert sample.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); SampleBytesRefAggregator.combineIntermediate(state, sample); } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefGroupingAggregatorFunction.java index db0d675499c44..ae911a74c4ca4 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleBytesRefGroupingAggregatorFunction.java @@ -158,7 +158,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -224,7 +224,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -275,7 +275,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleAggregatorFunction.java index fc5681e427572..e63c9fe414ce7 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleAggregatorFunction.java @@ -148,7 +148,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock sample = (BytesRefBlock) sampleUncast; assert sample.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); SampleDoubleAggregator.combineIntermediate(state, sample); } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleGroupingAggregatorFunction.java index b81c56db60297..f62100ee2e0ec 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleDoubleGroupingAggregatorFunction.java @@ -157,7 +157,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -220,7 +220,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -269,7 +269,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntAggregatorFunction.java index 232a664854401..b4035708a567b 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntAggregatorFunction.java @@ -148,7 +148,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock sample = (BytesRefBlock) sampleUncast; assert sample.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); SampleIntAggregator.combineIntermediate(state, sample); } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntGroupingAggregatorFunction.java index 41f2f7a608e8e..199676fa2fd2d 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleIntGroupingAggregatorFunction.java @@ -156,7 +156,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -219,7 +219,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -268,7 +268,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongAggregatorFunction.java index df885bd2292db..b78d48381ef8e 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongAggregatorFunction.java @@ -148,7 +148,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock sample = (BytesRefBlock) sampleUncast; assert sample.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); SampleLongAggregator.combineIntermediate(state, sample); } diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongGroupingAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongGroupingAggregatorFunction.java index 675827ad0caa3..4310849a9ebb7 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongGroupingAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/SampleLongGroupingAggregatorFunction.java @@ -157,7 +157,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -220,7 +220,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -269,7 +269,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock sample = (BytesRefBlock) sampleUncast; - BytesRef scratch = new BytesRef(); + BytesRef sampleScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefAggregatorFunction.java index c9aad2f067c4c..5042ba27a83a6 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopBytesRefAggregatorFunction.java @@ -154,7 +154,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock top = (BytesRefBlock) topUncast; assert top.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); TopBytesRefAggregator.combineIntermediate(state, top); } 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 dc6db83fc0f0d..676c70b480abe 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 @@ -162,7 +162,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock top = (BytesRefBlock) topUncast; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -227,7 +227,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock top = (BytesRefBlock) topUncast; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -278,7 +278,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock top = (BytesRefBlock) topUncast; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpAggregatorFunction.java index f5781c44f5e65..38c6e2c88c9f5 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/TopIpAggregatorFunction.java @@ -154,7 +154,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock top = (BytesRefBlock) topUncast; assert top.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); TopIpAggregator.combineIntermediate(state, top); } 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 18a6925ebbb34..a813402811302 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 @@ -162,7 +162,7 @@ public void addIntermediateInput(int positionOffset, IntArrayBlock groups, Page return; } BytesRefBlock top = (BytesRefBlock) topUncast; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -227,7 +227,7 @@ public void addIntermediateInput(int positionOffset, IntBigArrayBlock groups, Pa return; } BytesRefBlock top = (BytesRefBlock) topUncast; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { if (groups.isNull(groupPosition)) { continue; @@ -278,7 +278,7 @@ public void addIntermediateInput(int positionOffset, IntVector groups, Page page return; } BytesRefBlock top = (BytesRefBlock) topUncast; - BytesRef scratch = new BytesRef(); + BytesRef topScratch = new BytesRef(); for (int groupPosition = 0; groupPosition < groups.getPositionCount(); groupPosition++) { int groupId = groups.getInt(groupPosition); int valuesPosition = groupPosition + positionOffset; diff --git a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregatorFunction.java b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregatorFunction.java index 048467dddad48..d5da83e215f0c 100644 --- a/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregatorFunction.java +++ b/x-pack/plugin/esql/compute/src/main/generated/org/elasticsearch/compute/aggregation/ValuesBytesRefAggregatorFunction.java @@ -148,7 +148,7 @@ public void addIntermediateInput(Page page) { } BytesRefBlock values = (BytesRefBlock) valuesUncast; assert values.getPositionCount() == 1; - BytesRef scratch = new BytesRef(); + BytesRef valuesScratch = new BytesRef(); ValuesBytesRefAggregator.combineIntermediate(state, values); } From 00d6d781978340ce7f1f416a4935e7777e187c38 Mon Sep 17 00:00:00 2001 From: Jonas Kunz Date: Mon, 3 Nov 2025 09:16:23 +0100 Subject: [PATCH 3/4] Add hasVector method to Argument --- .../org/elasticsearch/compute/gen/AggregatorImplementer.java | 2 +- .../org/elasticsearch/compute/gen/EvaluatorImplementer.java | 2 +- .../compute/gen/GroupingAggregatorImplementer.java | 2 +- .../java/org/elasticsearch/compute/gen/argument/Argument.java | 4 ++++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java index 4bc9a6a42e7f0..6f0138528154c 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java @@ -122,7 +122,7 @@ public AggregatorImplementer( }).filter(a -> a instanceof PositionArgument == false).toList(); this.tryToUseVectors = aggParams.stream().anyMatch(a -> (a instanceof BlockArgument) == false) - && aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.dataType(false) == null); + && aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.hasVector() == false); this.createParameters = init.getParameters() .stream() diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java index f5d544fde7453..bf11146c71a16 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java @@ -73,7 +73,7 @@ public EvaluatorImplementer( this.processOutputsMultivalued = this.processFunction.hasBlockType; boolean anyParameterNotSupportingVectors = this.processFunction.args.stream() .filter(a -> a instanceof FixedArgument == false && a instanceof PositionArgument == false) - .anyMatch(a -> a.dataType(false) == null); + .anyMatch(a -> a.hasVector() == false); vectorsUnsupported = processOutputsMultivalued || anyParameterNotSupportingVectors; this.allNullsIsNull = allNullsIsNull; } 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 c2ed5f463913e..dc8ec81aef878 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 @@ -128,7 +128,7 @@ public GroupingAggregatorImplementer( }).filter(a -> a instanceof PositionArgument == false).toList(); this.hasOnlyBlockArguments = this.aggParams.stream().allMatch(a -> a instanceof BlockArgument); - this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.dataType(false) == null); + this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.hasVector() == false); this.createParameters = init.getParameters() .stream() diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java index 16eb9d851f100..936fa4b04cdfa 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java @@ -117,6 +117,10 @@ default TypeName elementType() { */ TypeName dataType(boolean blockStyle); + default boolean hasVector() { + return dataType(false) != null; + } + /** * The parameter passed to the real evaluation function */ From 6aca146fa147d46ba55ffb4438bbebf2d17c7eec Mon Sep 17 00:00:00 2001 From: Jonas Kunz Date: Mon, 3 Nov 2025 15:57:23 +0100 Subject: [PATCH 4/4] try to get rid of some instanceofs --- .../elasticsearch/compute/gen/AggregatorImplementer.java | 2 +- .../elasticsearch/compute/gen/EvaluatorImplementer.java | 5 +---- .../compute/gen/GroupingAggregatorImplementer.java | 2 +- .../org/elasticsearch/compute/gen/argument/Argument.java | 7 +++++-- .../elasticsearch/compute/gen/argument/ArrayArgument.java | 5 +++++ .../compute/gen/argument/StandardArgument.java | 5 +++++ 6 files changed, 18 insertions(+), 8 deletions(-) diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java index 6f0138528154c..80ae710a3c16c 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/AggregatorImplementer.java @@ -122,7 +122,7 @@ public AggregatorImplementer( }).filter(a -> a instanceof PositionArgument == false).toList(); this.tryToUseVectors = aggParams.stream().anyMatch(a -> (a instanceof BlockArgument) == false) - && aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.hasVector() == false); + && aggParams.stream().noneMatch(a -> a.supportsVectorReadAccess() == false); this.createParameters = init.getParameters() .stream() diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java index bf11146c71a16..3b1b184cb02d0 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/EvaluatorImplementer.java @@ -18,7 +18,6 @@ import org.elasticsearch.compute.gen.argument.BlockArgument; import org.elasticsearch.compute.gen.argument.BuilderArgument; import org.elasticsearch.compute.gen.argument.FixedArgument; -import org.elasticsearch.compute.gen.argument.PositionArgument; import java.util.ArrayList; import java.util.List; @@ -71,9 +70,7 @@ public EvaluatorImplementer( declarationType.getSimpleName() + extraName + "Evaluator" ); this.processOutputsMultivalued = this.processFunction.hasBlockType; - boolean anyParameterNotSupportingVectors = this.processFunction.args.stream() - .filter(a -> a instanceof FixedArgument == false && a instanceof PositionArgument == false) - .anyMatch(a -> a.hasVector() == false); + boolean anyParameterNotSupportingVectors = this.processFunction.args.stream().anyMatch(a -> a.supportsVectorReadAccess() == false); vectorsUnsupported = processOutputsMultivalued || anyParameterNotSupportingVectors; this.allNullsIsNull = allNullsIsNull; } 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 dc8ec81aef878..76edfbb1f70e3 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 @@ -128,7 +128,7 @@ public GroupingAggregatorImplementer( }).filter(a -> a instanceof PositionArgument == false).toList(); this.hasOnlyBlockArguments = this.aggParams.stream().allMatch(a -> a instanceof BlockArgument); - this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a instanceof StandardArgument && a.hasVector() == false); + this.allArgumentsSupportVectors = aggParams.stream().noneMatch(a -> a.supportsVectorReadAccess() == false); this.createParameters = init.getParameters() .stream() diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java index 936fa4b04cdfa..420989cfd0ddf 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/Argument.java @@ -117,8 +117,11 @@ default TypeName elementType() { */ TypeName dataType(boolean blockStyle); - default boolean hasVector() { - return dataType(false) != null; + /** + * False if and only if there is a block backing this parameter and that block does not support access as a vector. Otherwise true. + */ + default boolean supportsVectorReadAccess() { + return true; } /** diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java index d20296bf7f6db..08dd5fa478f2a 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/ArrayArgument.java @@ -35,6 +35,11 @@ public TypeName dataType(boolean blockStyle) { return ArrayTypeName.of(vectorType(type)); } + @Override + public boolean supportsVectorReadAccess() { + return vectorType(type) != null; + } + @Override public String paramName(boolean blockStyle) { return name + (blockStyle ? "Block" : "Vector") + "s"; diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java index 12b8ca98165bc..575c40a766ec1 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/argument/StandardArgument.java @@ -35,6 +35,11 @@ public TypeName dataType(boolean blockStyle) { return vectorType(type); } + @Override + public boolean supportsVectorReadAccess() { + return dataType(false) != null; + } + @Override public String paramName(boolean blockStyle) { return name + (blockStyle ? "Block" : "Vector");