diff --git a/benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java b/benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java index e805958d04e78..ce839a4c8eace 100644 --- a/benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java +++ b/benchmarks/src/main/java/org/elasticsearch/benchmark/compute/operator/EvalBenchmark.java @@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.compute.operator.Operator; import org.elasticsearch.core.TimeValue; @@ -79,14 +80,14 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) { return switch (operation) { case "abs" -> { FieldAttribute longField = longField(); - yield EvalMapper.toEvaluator(new Abs(Source.EMPTY, longField), layout(longField)).get(); + yield EvalMapper.toEvaluator(new Abs(Source.EMPTY, longField), layout(longField)).get(new DriverContext()); } case "add" -> { FieldAttribute longField = longField(); yield EvalMapper.toEvaluator( new Add(Source.EMPTY, longField, new Literal(Source.EMPTY, 1L, DataTypes.LONG)), layout(longField) - ).get(); + ).get(new DriverContext()); } case "date_trunc" -> { FieldAttribute timestamp = new FieldAttribute( @@ -97,28 +98,28 @@ private static EvalOperator.ExpressionEvaluator evaluator(String operation) { yield EvalMapper.toEvaluator( new DateTrunc(Source.EMPTY, new Literal(Source.EMPTY, Duration.ofHours(24), EsqlDataTypes.TIME_DURATION), timestamp), layout(timestamp) - ).get(); + ).get(new DriverContext()); } case "equal_to_const" -> { FieldAttribute longField = longField(); yield EvalMapper.toEvaluator( new Equals(Source.EMPTY, longField, new Literal(Source.EMPTY, 100_000L, DataTypes.LONG)), layout(longField) - ).get(); + ).get(new DriverContext()); } case "long_equal_to_long" -> { FieldAttribute lhs = longField(); FieldAttribute rhs = longField(); - yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(); + yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(new DriverContext()); } case "long_equal_to_int" -> { FieldAttribute lhs = longField(); FieldAttribute rhs = intField(); - yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(); + yield EvalMapper.toEvaluator(new Equals(Source.EMPTY, lhs, rhs), layout(lhs, rhs)).get(new DriverContext()); } case "mv_min", "mv_min_ascending" -> { FieldAttribute longField = longField(); - yield EvalMapper.toEvaluator(new MvMin(Source.EMPTY, longField), layout(longField)).get(); + yield EvalMapper.toEvaluator(new MvMin(Source.EMPTY, longField), layout(longField)).get(new DriverContext()); } default -> throw new UnsupportedOperationException(); }; 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 4ea351084bcc4..92601a232a68b 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 @@ -34,6 +34,7 @@ import static org.elasticsearch.compute.gen.Methods.getMethod; import static org.elasticsearch.compute.gen.Types.BLOCK; 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.EXPRESSION_EVALUATOR; import static org.elasticsearch.compute.gen.Types.PAGE; import static org.elasticsearch.compute.gen.Types.SOURCE; @@ -77,6 +78,7 @@ private TypeSpec type() { builder.addField(WARNINGS, "warnings", Modifier.PRIVATE, Modifier.FINAL); } processFunction.args.stream().forEach(a -> a.declareField(builder)); + builder.addField(DRIVER_CONTEXT, "driverContext", Modifier.PRIVATE, Modifier.FINAL); builder.addMethod(ctor()); builder.addMethod(eval()); @@ -95,6 +97,8 @@ private MethodSpec ctor() { builder.addStatement("this.warnings = new Warnings(source)"); } processFunction.args.stream().forEach(a -> a.implementCtor(builder)); + builder.addParameter(DRIVER_CONTEXT, "driverContext"); + builder.addStatement("this.driverContext = driverContext"); return builder.build(); } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/MvEvaluatorImplementer.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/MvEvaluatorImplementer.java index 124179b7447e8..9547548ba42ae 100644 --- a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/MvEvaluatorImplementer.java +++ b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/MvEvaluatorImplementer.java @@ -35,6 +35,7 @@ import static org.elasticsearch.compute.gen.Types.BLOCK; import static org.elasticsearch.compute.gen.Types.BYTES_REF; import static org.elasticsearch.compute.gen.Types.BYTES_REF_ARRAY; +import static org.elasticsearch.compute.gen.Types.DRIVER_CONTEXT; import static org.elasticsearch.compute.gen.Types.EXPRESSION_EVALUATOR; import static org.elasticsearch.compute.gen.Types.SOURCE; import static org.elasticsearch.compute.gen.Types.VECTOR; @@ -129,6 +130,7 @@ private TypeSpec type() { builder.addField(WARNINGS, "warnings", Modifier.PRIVATE, Modifier.FINAL); } + builder.addField(DRIVER_CONTEXT, "driverContext", Modifier.PRIVATE, Modifier.FINAL); builder.addMethod(ctor()); builder.addMethod(name()); @@ -159,6 +161,8 @@ private MethodSpec ctor() { if (warnExceptions.isEmpty() == false) { builder.addStatement("this.warnings = new Warnings(source)"); } + builder.addParameter(DRIVER_CONTEXT, "driverContext"); + builder.addStatement("this.driverContext = driverContext"); return builder.build(); } diff --git a/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java b/x-pack/plugin/esql/compute/gen/src/main/java/org/elasticsearch/compute/gen/Types.java index 2f76d1a73e480..4f98c10598bb8 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 @@ -88,6 +88,8 @@ public class Types { static final ClassName INTERMEDIATE_STATE_DESC = ClassName.get(AGGREGATION_PACKAGE, "IntermediateStateDesc"); static final TypeName LIST_AGG_FUNC_DESC = ParameterizedTypeName.get(ClassName.get(List.class), INTERMEDIATE_STATE_DESC); + static final ClassName DRIVER_CONTEXT = ClassName.get(OPERATOR_PACKAGE, "DriverContext"); + static final ClassName EXPRESSION_EVALUATOR = ClassName.get(OPERATOR_PACKAGE, "EvalOperator", "ExpressionEvaluator"); static final ClassName ABSTRACT_MULTIVALUE_FUNCTION_EVALUATOR = ClassName.get( "org.elasticsearch.xpack.esql.expression.function.scalar.multivalue", diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/ColumnExtractOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/ColumnExtractOperator.java index 8e5244cb75226..3facf9edc7765 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/ColumnExtractOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/ColumnExtractOperator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.ElementType; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import java.util.function.Supplier; @@ -19,13 +20,13 @@ public class ColumnExtractOperator extends AbstractPageMappingOperator { public record Factory( ElementType[] types, - Supplier inputEvalSupplier, + ExpressionEvaluator.Factory inputEvalSupplier, Supplier evaluatorSupplier ) implements OperatorFactory { @Override public Operator get(DriverContext driverContext) { - return new ColumnExtractOperator(types, inputEvalSupplier.get(), evaluatorSupplier.get()); + return new ColumnExtractOperator(types, inputEvalSupplier.get(driverContext), evaluatorSupplier.get()); } @Override diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverContext.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverContext.java index 6512c417b91ca..4e95e582769b5 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverContext.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/DriverContext.java @@ -7,10 +7,12 @@ package org.elasticsearch.compute.operator; +import org.elasticsearch.common.util.BigArrays; import org.elasticsearch.core.Releasable; import java.util.Collections; import java.util.IdentityHashMap; +import java.util.Objects; import java.util.Set; import java.util.concurrent.atomic.AtomicReference; @@ -33,11 +35,30 @@ */ public class DriverContext { + /** A default driver context. The returned bigArrays is non recycling. */ + public static DriverContext DEFAULT = new DriverContext(BigArrays.NON_RECYCLING_INSTANCE); + // Working set. Only the thread executing the driver will update this set. Set workingSet = Collections.newSetFromMap(new IdentityHashMap<>()); private final AtomicReference snapshot = new AtomicReference<>(); + private final BigArrays bigArrays; + + // For testing + public DriverContext() { + this(BigArrays.NON_RECYCLING_INSTANCE); + } + + public DriverContext(BigArrays bigArrays) { + Objects.requireNonNull(bigArrays); + this.bigArrays = bigArrays; + } + + public BigArrays bigArrays() { + return bigArrays; + } + /** A snapshot of the driver context. */ public record Snapshot(Set releasables) {} diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/EvalOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/EvalOperator.java index f15686897c008..7202f05b5562a 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/EvalOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/EvalOperator.java @@ -10,24 +10,22 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.Page; -import java.util.function.Supplier; - /** * Evaluates a tree of functions for every position in the block, resulting in a * new block which is appended to the page. */ public class EvalOperator extends AbstractPageMappingOperator { - public record EvalOperatorFactory(Supplier evaluator) implements OperatorFactory { + public record EvalOperatorFactory(ExpressionEvaluator.Factory evaluator) implements OperatorFactory { @Override public Operator get(DriverContext driverContext) { - return new EvalOperator(evaluator.get()); + return new EvalOperator(evaluator.get(driverContext)); } @Override public String describe() { - return "EvalOperator[evaluator=" + evaluator.get() + "]"; + return "EvalOperator[evaluator=" + evaluator.get(DriverContext.DEFAULT) + "]"; } } @@ -48,6 +46,12 @@ public String toString() { } public interface ExpressionEvaluator { + + /** A Factory for creating ExpressionEvaluators. */ + interface Factory { + ExpressionEvaluator get(DriverContext driverContext); + } + Block eval(Page page); } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/FilterOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/FilterOperator.java index 61e7c25d1000b..20864373e8016 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/FilterOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/FilterOperator.java @@ -10,24 +10,24 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import java.util.Arrays; -import java.util.function.Supplier; public class FilterOperator extends AbstractPageMappingOperator { private final EvalOperator.ExpressionEvaluator evaluator; - public record FilterOperatorFactory(Supplier evaluatorSupplier) implements OperatorFactory { + public record FilterOperatorFactory(ExpressionEvaluator.Factory evaluatorSupplier) implements OperatorFactory { @Override public Operator get(DriverContext driverContext) { - return new FilterOperator(evaluatorSupplier.get()); + return new FilterOperator(evaluatorSupplier.get(driverContext)); } @Override public String describe() { - return "FilterOperator[evaluator=" + evaluatorSupplier.get() + "]"; + return "FilterOperator[evaluator=" + evaluatorSupplier.get(DriverContext.DEFAULT) + "]"; } } diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/MultivalueDedupe.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/MultivalueDedupe.java index 7cfb080dc8c3e..03cd1442e3b9e 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/MultivalueDedupe.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/MultivalueDedupe.java @@ -15,8 +15,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Page; - -import java.util.function.Supplier; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; /** * Utilities to remove duplicates from multivalued fields. @@ -77,42 +76,39 @@ public static Block dedupeToBlockUsingCopyAndSort(Block block) { * Build and {@link EvalOperator.ExpressionEvaluator} that deduplicates values * using an adaptive algorithm based on the size of the input list. */ - public static Supplier evaluator( - ElementType elementType, - Supplier nextSupplier - ) { + public static ExpressionEvaluator.Factory evaluator(ElementType elementType, ExpressionEvaluator.Factory nextSupplier) { return switch (elementType) { - case BOOLEAN -> () -> new MvDedupeEvaluator(nextSupplier.get()) { + case BOOLEAN -> dvrCtx -> new MvDedupeEvaluator(nextSupplier.get(dvrCtx)) { @Override public Block eval(Page page) { return new MultivalueDedupeBoolean((BooleanBlock) field.eval(page)).dedupeToBlock(); } }; - case BYTES_REF -> () -> new MvDedupeEvaluator(nextSupplier.get()) { + case BYTES_REF -> dvrCtx -> new MvDedupeEvaluator(nextSupplier.get(dvrCtx)) { @Override public Block eval(Page page) { return new MultivalueDedupeBytesRef((BytesRefBlock) field.eval(page)).dedupeToBlockAdaptive(); } }; - case INT -> () -> new MvDedupeEvaluator(nextSupplier.get()) { + case INT -> dvrCtx -> new MvDedupeEvaluator(nextSupplier.get(dvrCtx)) { @Override public Block eval(Page page) { return new MultivalueDedupeInt((IntBlock) field.eval(page)).dedupeToBlockAdaptive(); } }; - case LONG -> () -> new MvDedupeEvaluator(nextSupplier.get()) { + case LONG -> dvrCtx -> new MvDedupeEvaluator(nextSupplier.get(dvrCtx)) { @Override public Block eval(Page page) { return new MultivalueDedupeLong((LongBlock) field.eval(page)).dedupeToBlockAdaptive(); } }; - case DOUBLE -> () -> new MvDedupeEvaluator(nextSupplier.get()) { + case DOUBLE -> dvrCtx -> new MvDedupeEvaluator(nextSupplier.get(dvrCtx)) { @Override public Block eval(Page page) { return new MultivalueDedupeDouble((DoubleBlock) field.eval(page)).dedupeToBlockAdaptive(); } }; - case NULL -> () -> new MvDedupeEvaluator(nextSupplier.get()) { + case NULL -> dvrCtx -> new MvDedupeEvaluator(nextSupplier.get(dvrCtx)) { @Override public Block eval(Page page) { return field.eval(page); // The page is all nulls and when you dedupe that it's still all nulls diff --git a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/StringExtractOperator.java b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/StringExtractOperator.java index d512f40e0dcbb..92ec89a12aa78 100644 --- a/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/StringExtractOperator.java +++ b/x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/operator/StringExtractOperator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.ElementType; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import java.util.Arrays; import java.util.Map; @@ -24,13 +25,13 @@ public class StringExtractOperator extends AbstractPageMappingOperator { public record StringExtractOperatorFactory( String[] fieldNames, - Supplier expressionEvaluator, + ExpressionEvaluator.Factory expressionEvaluator, Supplier>> parserSupplier ) implements OperatorFactory { @Override public Operator get(DriverContext driverContext) { - return new StringExtractOperator(fieldNames, expressionEvaluator.get(), parserSupplier.get()); + return new StringExtractOperator(fieldNames, expressionEvaluator.get(driverContext), parserSupplier.get()); } @Override diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/ColumnExtractOperatorTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/ColumnExtractOperatorTests.java index da67f9e6a68c0..c9b8dae1f9671 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/ColumnExtractOperatorTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/ColumnExtractOperatorTests.java @@ -47,7 +47,7 @@ public String toString() { @Override protected Operator.OperatorFactory simple(BigArrays bigArrays) { Supplier expEval = () -> new FirstWord(0); - return new ColumnExtractOperator.Factory(new ElementType[] { ElementType.BYTES_REF }, () -> page -> page.getBlock(0), expEval); + return new ColumnExtractOperator.Factory(new ElementType[] { ElementType.BYTES_REF }, dvrCtx -> page -> page.getBlock(0), expEval); } @Override diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/EvalOperatorTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/EvalOperatorTests.java index 2143e77d3ffc6..486a4be23f4c7 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/EvalOperatorTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/EvalOperatorTests.java @@ -40,7 +40,7 @@ public Block eval(Page page) { @Override protected Operator.OperatorFactory simple(BigArrays bigArrays) { - return new EvalOperator.EvalOperatorFactory(() -> new Addition(0, 1)); + return new EvalOperator.EvalOperatorFactory(dvrCtx -> new Addition(0, 1)); } @Override diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/FilterOperatorTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/FilterOperatorTests.java index 4724e09324fd5..146bafcd628e8 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/FilterOperatorTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/FilterOperatorTests.java @@ -42,7 +42,7 @@ public Block eval(Page page) { @Override protected Operator.OperatorFactory simple(BigArrays bigArrays) { - return new FilterOperator.FilterOperatorFactory(() -> new SameLastDigit(0, 1)); + return new FilterOperator.FilterOperatorFactory(dvrCtx -> new SameLastDigit(0, 1)); } @Override diff --git a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/StringExtractOperatorTests.java b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/StringExtractOperatorTests.java index 12bc5da607934..70cef5adec308 100644 --- a/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/StringExtractOperatorTests.java +++ b/x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/StringExtractOperatorTests.java @@ -42,7 +42,7 @@ public Map apply(String s) { @Override protected Operator.OperatorFactory simple(BigArrays bigArrays) { Supplier>> expEval = () -> new FirstWord("test"); - return new StringExtractOperator.StringExtractOperatorFactory(new String[] { "test" }, () -> page -> page.getBlock(0), expEval); + return new StringExtractOperator.StringExtractOperatorFactory(new String[] { "test" }, dvrCtx -> page -> page.getBlock(0), expEval); } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsBoolsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsBoolsEvaluator.java index 1afe66b50d318..7e74b54b74086 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsBoolsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsBoolsEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.BooleanVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class EqualsBoolsEvaluator implements EvalOperator.ExpressionEvalua private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public EqualsBoolsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsDoublesEvaluator.java index 296fba7c86d4f..0f52038f67ec7 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsDoublesEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class EqualsDoublesEvaluator implements EvalOperator.ExpressionEval private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public EqualsDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsIntsEvaluator.java index eb45790ce8cec..10491dcdf73dd 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsIntsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class EqualsIntsEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public EqualsIntsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsKeywordsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsKeywordsEvaluator.java index d3c0ae0cb447d..aa2d09be9bf72 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsKeywordsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsKeywordsEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class EqualsKeywordsEvaluator implements EvalOperator.ExpressionEva private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public EqualsKeywordsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsLongsEvaluator.java index 057e248176ca4..ad262b88c1641 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/EqualsLongsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class EqualsLongsEvaluator implements EvalOperator.ExpressionEvalua private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public EqualsLongsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanDoublesEvaluator.java index d351c5a4b4dc9..ed6da288d1e75 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanDoublesEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class GreaterThanDoublesEvaluator implements EvalOperator.Expressio private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanIntsEvaluator.java index ce6ca2dc10633..2ae3c956c5199 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanIntsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class GreaterThanIntsEvaluator implements EvalOperator.ExpressionEv private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanIntsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanKeywordsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanKeywordsEvaluator.java index caf53df3cef0c..53b0fe8dc8ef9 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanKeywordsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanKeywordsEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class GreaterThanKeywordsEvaluator implements EvalOperator.Expressi private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanKeywordsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanLongsEvaluator.java index b776ee8bbe65f..595f8f9fb1172 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanLongsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class GreaterThanLongsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanLongsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualDoublesEvaluator.java index 0febed41220b7..dd5eb8d86467a 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualDoublesEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class GreaterThanOrEqualDoublesEvaluator implements EvalOperator.Ex private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanOrEqualDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualIntsEvaluator.java index 9d74aa46b15d7..05d173d4e99b1 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualIntsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class GreaterThanOrEqualIntsEvaluator implements EvalOperator.Expre private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanOrEqualIntsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualKeywordsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualKeywordsEvaluator.java index d3a38217a0323..d4bc72d576c7b 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualKeywordsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualKeywordsEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class GreaterThanOrEqualKeywordsEvaluator implements EvalOperator.E private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanOrEqualKeywordsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualLongsEvaluator.java index 287fbf734bdee..5f7a4ad79217f 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/GreaterThanOrEqualLongsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class GreaterThanOrEqualLongsEvaluator implements EvalOperator.Expr private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public GreaterThanOrEqualLongsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanDoublesEvaluator.java index 016f17241cfe0..065486d6a38fa 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanDoublesEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class LessThanDoublesEvaluator implements EvalOperator.ExpressionEv private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanIntsEvaluator.java index ec4f304a886ae..a47a4cc72fafb 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanIntsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class LessThanIntsEvaluator implements EvalOperator.ExpressionEvalu private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanIntsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanKeywordsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanKeywordsEvaluator.java index a0ae3738eff17..d1d024075feef 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanKeywordsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanKeywordsEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class LessThanKeywordsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanKeywordsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanLongsEvaluator.java index 1174bd148643b..2aa35ea470649 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanLongsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class LessThanLongsEvaluator implements EvalOperator.ExpressionEval private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanLongsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualDoublesEvaluator.java index bba1892aae9be..21a4bb97f42ea 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualDoublesEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class LessThanOrEqualDoublesEvaluator implements EvalOperator.Expre private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanOrEqualDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualIntsEvaluator.java index 474743dcb89a5..db6130e498e2a 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualIntsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class LessThanOrEqualIntsEvaluator implements EvalOperator.Expressi private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanOrEqualIntsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualKeywordsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualKeywordsEvaluator.java index 61d5fecaeb348..46849d4b450f1 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualKeywordsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualKeywordsEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class LessThanOrEqualKeywordsEvaluator implements EvalOperator.Expr private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanOrEqualKeywordsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualLongsEvaluator.java index f96f858f631ba..4e05484d18f30 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/LessThanOrEqualLongsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class LessThanOrEqualLongsEvaluator implements EvalOperator.Express private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public LessThanOrEqualLongsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsBoolsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsBoolsEvaluator.java index 811e7eaafc384..a68b972ed0c52 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsBoolsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsBoolsEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.BooleanVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class NotEqualsBoolsEvaluator implements EvalOperator.ExpressionEva private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public NotEqualsBoolsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsDoublesEvaluator.java index 849cd2a456de6..fee6915f54e05 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsDoublesEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class NotEqualsDoublesEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public NotEqualsDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsIntsEvaluator.java index c34ccdc3d9fc4..e488cd0d16c23 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsIntsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class NotEqualsIntsEvaluator implements EvalOperator.ExpressionEval private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public NotEqualsIntsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsKeywordsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsKeywordsEvaluator.java index 880dd4f9d2d61..0f6a113062826 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsKeywordsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsKeywordsEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class NotEqualsKeywordsEvaluator implements EvalOperator.Expression private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public NotEqualsKeywordsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsLongsEvaluator.java index b06b8e3523a4d..21384ead1e745 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/NotEqualsLongsEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class NotEqualsLongsEvaluator implements EvalOperator.ExpressionEva private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public NotEqualsLongsEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/logical/NotEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/logical/NotEvaluator.java index c4ee4b44ca14c..98384f9cf0203 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/logical/NotEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/logical/NotEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.BooleanVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class NotEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public NotEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public NotEvaluator(EvalOperator.ExpressionEvaluator v, DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMatchEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMatchEvaluator.java index bea4a65bc6acc..001b0e1702f61 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMatchEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMatchEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -25,10 +26,13 @@ public final class RegexMatchEvaluator implements EvalOperator.ExpressionEvaluat private final CharacterRunAutomaton pattern; - public RegexMatchEvaluator(EvalOperator.ExpressionEvaluator input, - CharacterRunAutomaton pattern) { + private final DriverContext driverContext; + + public RegexMatchEvaluator(EvalOperator.ExpressionEvaluator input, CharacterRunAutomaton pattern, + DriverContext driverContext) { this.input = input; this.pattern = pattern; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBooleanEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBooleanEvaluator.java index e5e63c5a22a03..463c10a14ee5e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBooleanEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBooleanEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.BooleanVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class GreatestBooleanEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public GreatestBooleanEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public GreatestBooleanEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBytesRefEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBytesRefEvaluator.java index a6ea67a79f4b1..f6d6b62b5d3bd 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBytesRefEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestBytesRefEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,12 @@ public final class GreatestBytesRefEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public GreatestBytesRefEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public GreatestBytesRefEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestDoubleEvaluator.java index 78701ba2a417f..22ae82dc0d0ac 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestDoubleEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class GreatestDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public GreatestDoubleEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public GreatestDoubleEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestIntEvaluator.java index 9f1e98b358c84..c2cc45bc8b180 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestIntEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class GreatestIntEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public GreatestIntEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public GreatestIntEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestLongEvaluator.java index 5f3a8bdbf5dab..e148c55b36d61 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/GreatestLongEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class GreatestLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public GreatestLongEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public GreatestLongEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBooleanEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBooleanEvaluator.java index ebf3028d80869..8aa566235c035 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBooleanEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBooleanEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.BooleanVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class LeastBooleanEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public LeastBooleanEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public LeastBooleanEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBytesRefEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBytesRefEvaluator.java index 46fcbbca1326d..c4dd29e583169 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBytesRefEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastBytesRefEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,12 @@ public final class LeastBytesRefEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public LeastBytesRefEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public LeastBytesRefEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastDoubleEvaluator.java index c046cc2723e7e..43ada40582c31 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastDoubleEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class LeastDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public LeastDoubleEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public LeastDoubleEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastIntEvaluator.java index 0c1d30eeee3b7..15396c59dfa2c 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastIntEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,11 @@ public final class LeastIntEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public LeastIntEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public LeastIntEvaluator(EvalOperator.ExpressionEvaluator[] values, DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastLongEvaluator.java index 314ea40744030..2115d9c19b7fb 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/LeastLongEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ public final class LeastLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public LeastLongEvaluator(EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public LeastLongEvaluator(EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractConstantEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractConstantEvaluator.java index 920581cdeaf80..bae85f15dc525 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractConstantEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -25,11 +26,14 @@ public final class DateExtractConstantEvaluator implements EvalOperator.Expressi private final ZoneId zone; + private final DriverContext driverContext; + public DateExtractConstantEvaluator(EvalOperator.ExpressionEvaluator value, - ChronoField chronoField, ZoneId zone) { + ChronoField chronoField, ZoneId zone, DriverContext driverContext) { this.value = value; this.chronoField = chronoField; this.zone = zone; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractEvaluator.java index f4893d59a9f2d..0704a84e9d39e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtractEvaluator.java @@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -32,12 +33,15 @@ public final class DateExtractEvaluator implements EvalOperator.ExpressionEvalua private final ZoneId zone; + private final DriverContext driverContext; + public DateExtractEvaluator(Source source, EvalOperator.ExpressionEvaluator value, - EvalOperator.ExpressionEvaluator chronoField, ZoneId zone) { + EvalOperator.ExpressionEvaluator chronoField, ZoneId zone, DriverContext driverContext) { this.warnings = new Warnings(source); this.value = value; this.chronoField = chronoField; this.zone = zone; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatConstantEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatConstantEvaluator.java index dc2c041532bb8..fdfc28b0af3b9 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatConstantEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class DateFormatConstantEvaluator implements EvalOperator.Expressio private final DateFormatter formatter; - public DateFormatConstantEvaluator(EvalOperator.ExpressionEvaluator val, - DateFormatter formatter) { + private final DriverContext driverContext; + + public DateFormatConstantEvaluator(EvalOperator.ExpressionEvaluator val, DateFormatter formatter, + DriverContext driverContext) { this.val = val; this.formatter = formatter; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatEvaluator.java index 847cbc011f8ad..7fbb705c95335 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormatEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -27,11 +28,14 @@ public final class DateFormatEvaluator implements EvalOperator.ExpressionEvaluat private final Locale locale; + private final DriverContext driverContext; + public DateFormatEvaluator(EvalOperator.ExpressionEvaluator val, - EvalOperator.ExpressionEvaluator formatter, Locale locale) { + EvalOperator.ExpressionEvaluator formatter, Locale locale, DriverContext driverContext) { this.val = val; this.formatter = formatter; this.locale = locale; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseConstantEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseConstantEvaluator.java index 7130476b96e23..8a714985c666d 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseConstantEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseConstantEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -29,11 +30,14 @@ public final class DateParseConstantEvaluator implements EvalOperator.Expression private final DateFormatter formatter; + private final DriverContext driverContext; + public DateParseConstantEvaluator(Source source, EvalOperator.ExpressionEvaluator val, - DateFormatter formatter) { + DateFormatter formatter, DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; this.formatter = formatter; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseEvaluator.java index a4f79021c1e70..cc0cfc62a1921 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParseEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -31,12 +32,15 @@ public final class DateParseEvaluator implements EvalOperator.ExpressionEvaluato private final ZoneId zoneId; + private final DriverContext driverContext; + public DateParseEvaluator(Source source, EvalOperator.ExpressionEvaluator val, - EvalOperator.ExpressionEvaluator formatter, ZoneId zoneId) { + EvalOperator.ExpressionEvaluator formatter, ZoneId zoneId, DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; this.formatter = formatter; this.zoneId = zoneId; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTruncEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTruncEvaluator.java index 42d9fc3250919..79c36712313a0 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTruncEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTruncEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -22,9 +23,13 @@ public final class DateTruncEvaluator implements EvalOperator.ExpressionEvaluato private final Rounding.Prepared rounding; - public DateTruncEvaluator(EvalOperator.ExpressionEvaluator fieldVal, Rounding.Prepared rounding) { + private final DriverContext driverContext; + + public DateTruncEvaluator(EvalOperator.ExpressionEvaluator fieldVal, Rounding.Prepared rounding, + DriverContext driverContext) { this.fieldVal = fieldVal; this.rounding = rounding; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/NowEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/NowEvaluator.java index 290662cfc33ba..49cf0727b4781 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/NowEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/date/NowEvaluator.java @@ -9,6 +9,7 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -18,8 +19,11 @@ public final class NowEvaluator implements EvalOperator.ExpressionEvaluator { private final long now; - public NowEvaluator(long now) { + private final DriverContext driverContext; + + public NowEvaluator(long now, DriverContext driverContext) { this.now = now; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatchEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatchEvaluator.java index d87502789de97..6241093a607c8 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatchEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatchEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -25,10 +26,13 @@ public final class CIDRMatchEvaluator implements EvalOperator.ExpressionEvaluato private final EvalOperator.ExpressionEvaluator[] cidrs; + private final DriverContext driverContext; + public CIDRMatchEvaluator(EvalOperator.ExpressionEvaluator ip, - EvalOperator.ExpressionEvaluator[] cidrs) { + EvalOperator.ExpressionEvaluator[] cidrs, DriverContext driverContext) { this.ip = ip; this.cidrs = cidrs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsDoubleEvaluator.java index 8250081a5ddd8..f9e8f72d981c2 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,12 @@ public final class AbsDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator fieldVal; - public AbsDoubleEvaluator(EvalOperator.ExpressionEvaluator fieldVal) { + private final DriverContext driverContext; + + public AbsDoubleEvaluator(EvalOperator.ExpressionEvaluator fieldVal, + DriverContext driverContext) { this.fieldVal = fieldVal; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsIntEvaluator.java index 1282d3f7401d6..e974bd69063e5 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsIntEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class AbsIntEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator fieldVal; - public AbsIntEvaluator(EvalOperator.ExpressionEvaluator fieldVal) { + private final DriverContext driverContext; + + public AbsIntEvaluator(EvalOperator.ExpressionEvaluator fieldVal, DriverContext driverContext) { this.fieldVal = fieldVal; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsLongEvaluator.java index 3d87f8007d4ba..f2e01666c25e6 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbsLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class AbsLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator fieldVal; - public AbsLongEvaluator(EvalOperator.ExpressionEvaluator fieldVal) { + private final DriverContext driverContext; + + public AbsLongEvaluator(EvalOperator.ExpressionEvaluator fieldVal, DriverContext driverContext) { this.fieldVal = fieldVal; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AcosEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AcosEvaluator.java index 3d95122009b7d..c966c0599bb51 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AcosEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AcosEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class AcosEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public AcosEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public AcosEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AsinEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AsinEvaluator.java index 61cced3385905..159734187f8e5 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AsinEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AsinEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class AsinEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public AsinEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public AsinEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2Evaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2Evaluator.java index 4ea7cb15c625c..3a3bcf2594495 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2Evaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2Evaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,9 +22,13 @@ public final class Atan2Evaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator x; - public Atan2Evaluator(EvalOperator.ExpressionEvaluator y, EvalOperator.ExpressionEvaluator x) { + private final DriverContext driverContext; + + public Atan2Evaluator(EvalOperator.ExpressionEvaluator y, EvalOperator.ExpressionEvaluator x, + DriverContext driverContext) { this.y = y; this.x = x; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AtanEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AtanEvaluator.java index fac99b790d262..6896e65441c86 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AtanEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/AtanEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class AtanEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public AtanEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public AtanEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToDoubleEvaluator.java index 95105fce34831..61709f909b850 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToDoubleEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,11 @@ public final class CastIntToDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public CastIntToDoubleEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public CastIntToDoubleEvaluator(EvalOperator.ExpressionEvaluator v, DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToLongEvaluator.java index 76f4bc3a89cb3..83628ea5962d7 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToLongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,11 @@ public final class CastIntToLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public CastIntToLongEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public CastIntToLongEvaluator(EvalOperator.ExpressionEvaluator v, DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToUnsignedLongEvaluator.java index 7b8bfc2b8d199..4e52416b98654 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastIntToUnsignedLongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,12 @@ public final class CastIntToUnsignedLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public CastIntToUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public CastIntToUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator v, + DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToDoubleEvaluator.java index 22d3f4f5b8c48..f3a5501edf781 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToDoubleEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,12 @@ public final class CastLongToDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public CastLongToDoubleEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public CastLongToDoubleEvaluator(EvalOperator.ExpressionEvaluator v, + DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToUnsignedLongEvaluator.java index de215d3e22373..23179757e7532 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastLongToUnsignedLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,12 @@ public final class CastLongToUnsignedLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public CastLongToUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public CastLongToUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator v, + DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastUnsignedLongToDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastUnsignedLongToDoubleEvaluator.java index d1e009c2a0b2e..0f149bf7ae340 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastUnsignedLongToDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CastUnsignedLongToDoubleEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,12 @@ public final class CastUnsignedLongToDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public CastUnsignedLongToDoubleEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public CastUnsignedLongToDoubleEvaluator(EvalOperator.ExpressionEvaluator v, + DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CeilDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CeilDoubleEvaluator.java index a951cb8c30b0b..79f8143564a42 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CeilDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CeilDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class CeilDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public CeilDoubleEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public CeilDoubleEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CosEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CosEvaluator.java index 226bca608e01e..bcf054989d31c 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CosEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CosEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class CosEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public CosEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public CosEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CoshEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CoshEvaluator.java index 2ff9dc6e8ef4d..73819619937ed 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CoshEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/CoshEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class CoshEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public CoshEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public CoshEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/FloorDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/FloorDoubleEvaluator.java index d7b5a1263e85d..75db4ac7b2b38 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/FloorDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/FloorDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class FloorDoubleEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public FloorDoubleEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public FloorDoubleEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFiniteEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFiniteEvaluator.java index 233c95aea3cfd..f17b7dfe91c21 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFiniteEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFiniteEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,11 @@ public final class IsFiniteEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public IsFiniteEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public IsFiniteEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfiniteEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfiniteEvaluator.java index b53623bc48514..37b1f58efe49f 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfiniteEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfiniteEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,11 @@ public final class IsInfiniteEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public IsInfiniteEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public IsInfiniteEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaNEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaNEvaluator.java index c947eb5126c45..1fff9b81f08e9 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaNEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaNEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,11 @@ public final class IsNaNEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public IsNaNEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public IsNaNEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10DoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10DoubleEvaluator.java index 15eaa7388944f..03175592f1df3 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10DoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10DoubleEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class Log10DoubleEvaluator implements EvalOperator.ExpressionEvalua private final EvalOperator.ExpressionEvaluator val; - public Log10DoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public Log10DoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10IntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10IntEvaluator.java index c3c95930836cd..11ce92c7f17ff 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10IntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10IntEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -25,9 +26,13 @@ public final class Log10IntEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator val; - public Log10IntEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public Log10IntEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10LongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10LongEvaluator.java index e8c1e590b9084..658f0575e9e94 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10LongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10LongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -25,9 +26,13 @@ public final class Log10LongEvaluator implements EvalOperator.ExpressionEvaluato private final EvalOperator.ExpressionEvaluator val; - public Log10LongEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public Log10LongEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10UnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10UnsignedLongEvaluator.java index faa75ee571eb9..e179ac4cb8f27 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10UnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10UnsignedLongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -25,9 +26,13 @@ public final class Log10UnsignedLongEvaluator implements EvalOperator.Expression private final EvalOperator.ExpressionEvaluator val; - public Log10UnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public Log10UnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowDoubleEvaluator.java index 0ecd7f5455942..6ff5f5f0d510e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowDoubleEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class PowDoubleEvaluator implements EvalOperator.ExpressionEvaluato private final EvalOperator.ExpressionEvaluator exponent; + private final DriverContext driverContext; + public PowDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator base, - EvalOperator.ExpressionEvaluator exponent) { + EvalOperator.ExpressionEvaluator exponent, DriverContext driverContext) { this.warnings = new Warnings(source); this.base = base; this.exponent = exponent; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowIntEvaluator.java index 65a20463c26e1..70a663d2b933e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowIntEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -27,11 +28,14 @@ public final class PowIntEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator exponent; + private final DriverContext driverContext; + public PowIntEvaluator(Source source, EvalOperator.ExpressionEvaluator base, - EvalOperator.ExpressionEvaluator exponent) { + EvalOperator.ExpressionEvaluator exponent, DriverContext driverContext) { this.warnings = new Warnings(source); this.base = base; this.exponent = exponent; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowLongEvaluator.java index 99ee34f7ee770..870f0b75dedca 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/PowLongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -27,11 +28,14 @@ public final class PowLongEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator exponent; + private final DriverContext driverContext; + public PowLongEvaluator(Source source, EvalOperator.ExpressionEvaluator base, - EvalOperator.ExpressionEvaluator exponent) { + EvalOperator.ExpressionEvaluator exponent, DriverContext driverContext) { this.warnings = new Warnings(source); this.base = base; this.exponent = exponent; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleEvaluator.java index 52a51ba610d38..4d4a3deb2cc7a 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class RoundDoubleEvaluator implements EvalOperator.ExpressionEvalua private final EvalOperator.ExpressionEvaluator decimals; + private final DriverContext driverContext; + public RoundDoubleEvaluator(EvalOperator.ExpressionEvaluator val, - EvalOperator.ExpressionEvaluator decimals) { + EvalOperator.ExpressionEvaluator decimals, DriverContext driverContext) { this.val = val; this.decimals = decimals; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleNoDecimalsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleNoDecimalsEvaluator.java index 671aaf5f3d029..eeb5eedf25f0d 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleNoDecimalsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundDoubleNoDecimalsEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,12 @@ public final class RoundDoubleNoDecimalsEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public RoundDoubleNoDecimalsEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public RoundDoubleNoDecimalsEvaluator(EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundIntEvaluator.java index f178a571b7e9d..e73bbc05f72c2 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundIntEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -23,10 +24,13 @@ public final class RoundIntEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator decimals; + private final DriverContext driverContext; + public RoundIntEvaluator(EvalOperator.ExpressionEvaluator val, - EvalOperator.ExpressionEvaluator decimals) { + EvalOperator.ExpressionEvaluator decimals, DriverContext driverContext) { this.val = val; this.decimals = decimals; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundLongEvaluator.java index 12f193fe216f3..e2bfc94b4205f 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class RoundLongEvaluator implements EvalOperator.ExpressionEvaluato private final EvalOperator.ExpressionEvaluator decimals; + private final DriverContext driverContext; + public RoundLongEvaluator(EvalOperator.ExpressionEvaluator val, - EvalOperator.ExpressionEvaluator decimals) { + EvalOperator.ExpressionEvaluator decimals, DriverContext driverContext) { this.val = val; this.decimals = decimals; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundUnsignedLongEvaluator.java index 1a8247ba34c80..15bbc619a66d6 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundUnsignedLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class RoundUnsignedLongEvaluator implements EvalOperator.Expression private final EvalOperator.ExpressionEvaluator decimals; + private final DriverContext driverContext; + public RoundUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator val, - EvalOperator.ExpressionEvaluator decimals) { + EvalOperator.ExpressionEvaluator decimals, DriverContext driverContext) { this.val = val; this.decimals = decimals; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinEvaluator.java index aa1649021be09..a7483e84ee730 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class SinEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public SinEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public SinEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinhEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinhEvaluator.java index 43ec78d3289f8..ba985f76fac20 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinhEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SinhEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class SinhEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public SinhEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public SinhEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtDoubleEvaluator.java index c60176d3e7135..39d15c6e143cc 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtDoubleEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class SqrtDoubleEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator val; - public SqrtDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public SqrtDoubleEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtIntEvaluator.java index 1241e35e8f5db..6fc49da574015 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtIntEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -25,9 +26,13 @@ public final class SqrtIntEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator val; - public SqrtIntEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public SqrtIntEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtLongEvaluator.java index 8dc27fada343a..8506b02f1aa27 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtLongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -25,9 +26,13 @@ public final class SqrtLongEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator val; - public SqrtLongEvaluator(Source source, EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public SqrtLongEvaluator(Source source, EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.warnings = new Warnings(source); this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtUnsignedLongEvaluator.java index c72a767e90a13..1b01e45679ad4 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/SqrtUnsignedLongEvaluator.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,8 +22,12 @@ public final class SqrtUnsignedLongEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public SqrtUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public SqrtUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator val, + DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanEvaluator.java index 0c8de1fe98abc..387a4b6148e1e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class TanEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public TanEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public TanEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanhEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanhEvaluator.java index 207ae56fb227d..451a85aa71c22 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanhEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/math/TanhEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class TanhEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public TanhEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public TanhEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgDoubleEvaluator.java index 775723ee66c0b..695844228c9ea 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleArrayVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; @@ -18,8 +19,11 @@ * This class is generated. Do not edit it. */ public final class MvAvgDoubleEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvAvgDoubleEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvAvgDoubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgIntEvaluator.java index 655d9fdbe97a4..e85741f4ec501 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgIntEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; @@ -19,8 +20,11 @@ * This class is generated. Do not edit it. */ public final class MvAvgIntEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvAvgIntEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvAvgIntEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgLongEvaluator.java index 95dee758eaa32..b96096b8fe22e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgLongEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; @@ -19,8 +20,11 @@ * This class is generated. Do not edit it. */ public final class MvAvgLongEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvAvgLongEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvAvgLongEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgUnsignedLongEvaluator.java index 97845cd82e105..b0e0864c7017c 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvgUnsignedLongEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; @@ -19,8 +20,12 @@ * This class is generated. Do not edit it. */ public final class MvAvgUnsignedLongEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvAvgUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvAvgUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBooleanEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBooleanEvaluator.java index a2cf3af0bd9e2..9ab7e6919d68e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBooleanEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBooleanEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.BooleanArrayVector; import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,12 @@ * This class is generated. Do not edit it. */ public final class MvMaxBooleanEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMaxBooleanEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMaxBooleanEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBytesRefEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBytesRefEvaluator.java index b96d9830b9cdc..5101d380c447e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBytesRefEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxBytesRefEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefArrayVector; import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ * This class is generated. Do not edit it. */ public final class MvMaxBytesRefEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMaxBytesRefEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMaxBytesRefEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxDoubleEvaluator.java index 0465808883020..4898a2ddac0ab 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleArrayVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMaxDoubleEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMaxDoubleEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMaxDoubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxIntEvaluator.java index e166fa38a1eae..fdeb4c4c5a469 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxIntEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.IntArrayVector; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMaxIntEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMaxIntEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMaxIntEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxLongEvaluator.java index fe72bdd726c20..99e79f59160a6 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMaxLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongArrayVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMaxLongEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMaxLongEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMaxLongEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianDoubleEvaluator.java index 266b2b8e3d4f9..ab2422df3b7b1 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleArrayVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,12 @@ * This class is generated. Do not edit it. */ public final class MvMedianDoubleEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMedianDoubleEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMedianDoubleEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianIntEvaluator.java index d20f953a6d34c..f66e1b65ed131 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianIntEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.IntArrayVector; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMedianIntEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMedianIntEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMedianIntEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianLongEvaluator.java index 710d79e8aa6f6..7ced56110af42 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongArrayVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,12 @@ * This class is generated. Do not edit it. */ public final class MvMedianLongEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMedianLongEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMedianLongEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianUnsignedLongEvaluator.java index cfefbb492d53e..162608e055374 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedianUnsignedLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongArrayVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,12 @@ * This class is generated. Do not edit it. */ public final class MvMedianUnsignedLongEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMedianUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMedianUnsignedLongEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBooleanEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBooleanEvaluator.java index 5e3697243d9cb..3a67c042d82f0 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBooleanEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBooleanEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.BooleanArrayVector; import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,12 @@ * This class is generated. Do not edit it. */ public final class MvMinBooleanEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMinBooleanEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMinBooleanEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBytesRefEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBytesRefEvaluator.java index 74173a3d18e5b..538cf9dbed307 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBytesRefEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinBytesRefEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefArrayVector; import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,12 @@ * This class is generated. Do not edit it. */ public final class MvMinBytesRefEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMinBytesRefEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMinBytesRefEvaluator(EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinDoubleEvaluator.java index 5fd2d66a2afce..905c6dc87eaf1 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleArrayVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMinDoubleEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMinDoubleEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMinDoubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinIntEvaluator.java index 37d3b5c98778b..f71ea2a663314 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinIntEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.IntArrayVector; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMinIntEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMinIntEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMinIntEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinLongEvaluator.java index f0f0734e8d176..da44e992c266f 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMinLongEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.LongArrayVector; import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -17,8 +18,11 @@ * This class is generated. Do not edit it. */ public final class MvMinLongEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvMinLongEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvMinLongEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumDoubleEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumDoubleEvaluator.java index e945863404fa7..4b7903ae2b4c2 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumDoubleEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumDoubleEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleArrayVector; import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; @@ -18,8 +19,11 @@ * This class is generated. Do not edit it. */ public final class MvSumDoubleEvaluator extends AbstractMultivalueFunction.AbstractEvaluator { - public MvSumDoubleEvaluator(EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvSumDoubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext driverContext) { super(field); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumIntEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumIntEvaluator.java index e1217cae07ec3..da7abdfd1efd4 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumIntEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumIntEvaluator.java @@ -9,6 +9,7 @@ import java.lang.String; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.IntBlock; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -20,9 +21,13 @@ public final class MvSumIntEvaluator extends AbstractMultivalueFunction.AbstractNullableEvaluator { private final Warnings warnings; - public MvSumIntEvaluator(Source source, EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvSumIntEvaluator(Source source, EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); this.warnings = new Warnings(source); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumLongEvaluator.java index 4f5c301448b43..f669e88e1aeba 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumLongEvaluator.java @@ -9,6 +9,7 @@ import java.lang.String; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.LongBlock; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -20,9 +21,13 @@ public final class MvSumLongEvaluator extends AbstractMultivalueFunction.AbstractNullableEvaluator { private final Warnings warnings; - public MvSumLongEvaluator(Source source, EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvSumLongEvaluator(Source source, EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); this.warnings = new Warnings(source); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumUnsignedLongEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumUnsignedLongEvaluator.java index 6e78f1e851921..18773ea49f245 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumUnsignedLongEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSumUnsignedLongEvaluator.java @@ -9,6 +9,7 @@ import java.lang.String; import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.LongBlock; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -20,9 +21,13 @@ public final class MvSumUnsignedLongEvaluator extends AbstractMultivalueFunction.AbstractNullableEvaluator { private final Warnings warnings; - public MvSumUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator field) { + private final DriverContext driverContext; + + public MvSumUnsignedLongEvaluator(Source source, EvalOperator.ExpressionEvaluator field, + DriverContext driverContext) { super(field); this.warnings = new Warnings(source); + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatEvaluator.java index 0d0d9dd23091e..868e6338536e8 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,9 +25,13 @@ public final class ConcatEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator[] values; - public ConcatEvaluator(BytesRefBuilder scratch, EvalOperator.ExpressionEvaluator[] values) { + private final DriverContext driverContext; + + public ConcatEvaluator(BytesRefBuilder scratch, EvalOperator.ExpressionEvaluator[] values, + DriverContext driverContext) { this.scratch = scratch; this.values = values; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrimEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrimEvaluator.java index 19bb7f4cb4e6a..594f521c76da5 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrimEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrimEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,11 @@ public final class LTrimEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public LTrimEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public LTrimEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftEvaluator.java index 23ccb4d544331..05da38fe7d09d 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -29,12 +30,16 @@ public final class LeftEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator length; + private final DriverContext driverContext; + public LeftEvaluator(BytesRef out, UnicodeUtil.UTF8CodePoint cp, - EvalOperator.ExpressionEvaluator str, EvalOperator.ExpressionEvaluator length) { + EvalOperator.ExpressionEvaluator str, EvalOperator.ExpressionEvaluator length, + DriverContext driverContext) { this.out = out; this.cp = cp; this.str = str; this.length = length; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LengthEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LengthEvaluator.java index c32ebf511dc99..38d9adaf1184c 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LengthEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/LengthEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -22,8 +23,11 @@ public final class LengthEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public LengthEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public LengthEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrimEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrimEvaluator.java index 946542427c53b..f1a07fbcbd7f4 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrimEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrimEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,11 @@ public final class RTrimEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public RTrimEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public RTrimEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightEvaluator.java index f075c37d05dd9..35d05b53faf04 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightEvaluator.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -29,12 +30,16 @@ public final class RightEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator length; + private final DriverContext driverContext; + public RightEvaluator(BytesRef out, UnicodeUtil.UTF8CodePoint cp, - EvalOperator.ExpressionEvaluator str, EvalOperator.ExpressionEvaluator length) { + EvalOperator.ExpressionEvaluator str, EvalOperator.ExpressionEvaluator length, + DriverContext driverContext) { this.out = out; this.cp = cp; this.str = str; this.length = length; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitSingleByteEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitSingleByteEvaluator.java index 5f721c3d8ad88..29ee86b1aeca2 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitSingleByteEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitSingleByteEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,11 +25,14 @@ public final class SplitSingleByteEvaluator implements EvalOperator.ExpressionEv private final BytesRef scratch; + private final DriverContext driverContext; + public SplitSingleByteEvaluator(EvalOperator.ExpressionEvaluator str, byte delim, - BytesRef scratch) { + BytesRef scratch, DriverContext driverContext) { this.str = str; this.delim = delim; this.scratch = scratch; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitVariableEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitVariableEvaluator.java index 090f580b8ce06..8577aa7cc3fc7 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitVariableEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitVariableEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,11 +25,14 @@ public final class SplitVariableEvaluator implements EvalOperator.ExpressionEval private final BytesRef scratch; + private final DriverContext driverContext; + public SplitVariableEvaluator(EvalOperator.ExpressionEvaluator str, - EvalOperator.ExpressionEvaluator delim, BytesRef scratch) { + EvalOperator.ExpressionEvaluator delim, BytesRef scratch, DriverContext driverContext) { this.str = str; this.delim = delim; this.scratch = scratch; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithEvaluator.java index 2fe2c13ca0659..1ec6f97836025 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWithEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class StartsWithEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator prefix; + private final DriverContext driverContext; + public StartsWithEvaluator(EvalOperator.ExpressionEvaluator str, - EvalOperator.ExpressionEvaluator prefix) { + EvalOperator.ExpressionEvaluator prefix, DriverContext driverContext) { this.str = str; this.prefix = prefix; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringEvaluator.java index 75a35bee93db8..3c86a51c513dc 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -26,11 +27,15 @@ public final class SubstringEvaluator implements EvalOperator.ExpressionEvaluato private final EvalOperator.ExpressionEvaluator length; + private final DriverContext driverContext; + public SubstringEvaluator(EvalOperator.ExpressionEvaluator str, - EvalOperator.ExpressionEvaluator start, EvalOperator.ExpressionEvaluator length) { + EvalOperator.ExpressionEvaluator start, EvalOperator.ExpressionEvaluator length, + DriverContext driverContext) { this.str = str; this.start = start; this.length = length; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringNoLengthEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringNoLengthEvaluator.java index 71fb35a06dfa3..cbe96b7056a75 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringNoLengthEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringNoLengthEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -24,10 +25,13 @@ public final class SubstringNoLengthEvaluator implements EvalOperator.Expression private final EvalOperator.ExpressionEvaluator start; + private final DriverContext driverContext; + public SubstringNoLengthEvaluator(EvalOperator.ExpressionEvaluator str, - EvalOperator.ExpressionEvaluator start) { + EvalOperator.ExpressionEvaluator start, DriverContext driverContext) { this.str = str; this.start = start; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/TrimEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/TrimEvaluator.java index d276116afbf55..dceffc22cec7c 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/TrimEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/function/scalar/string/TrimEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.BytesRefVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -20,8 +21,11 @@ public final class TrimEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator val; - public TrimEvaluator(EvalOperator.ExpressionEvaluator val) { + private final DriverContext driverContext; + + public TrimEvaluator(EvalOperator.ExpressionEvaluator val, DriverContext driverContext) { this.val = val; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDatetimesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDatetimesEvaluator.java index 84d8809454f8d..5562085ba01fd 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDatetimesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDatetimesEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -28,11 +29,14 @@ public final class AddDatetimesEvaluator implements EvalOperator.ExpressionEvalu private final TemporalAmount temporalAmount; + private final DriverContext driverContext; + public AddDatetimesEvaluator(Source source, EvalOperator.ExpressionEvaluator datetime, - TemporalAmount temporalAmount) { + TemporalAmount temporalAmount, DriverContext driverContext) { this.warnings = new Warnings(source); this.datetime = datetime; this.temporalAmount = temporalAmount; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDoublesEvaluator.java index af04a4c68e021..86a4f83045725 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddDoublesEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class AddDoublesEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public AddDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddIntsEvaluator.java index 35d80b4604c74..1c9e2227af750 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddIntsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class AddIntsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public AddIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddLongsEvaluator.java index 0a66f66d8da7e..80d401d42bf02 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class AddLongsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public AddLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddUnsignedLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddUnsignedLongsEvaluator.java index 1bf3b8fa3ddb7..e48572f7980d1 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddUnsignedLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/AddUnsignedLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class AddUnsignedLongsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public AddUnsignedLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivDoublesEvaluator.java index 4b13bc1c5c072..e4ce48a844de3 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivDoublesEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class DivDoublesEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public DivDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivIntsEvaluator.java index 5cdc73fbd99bb..8b905ca7a0a4f 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivIntsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class DivIntsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public DivIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivLongsEvaluator.java index 7a7311152f924..155beeff58f45 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class DivLongsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public DivLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivUnsignedLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivUnsignedLongsEvaluator.java index de0ce3aafb46f..f5c949351bb0f 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivUnsignedLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DivUnsignedLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class DivUnsignedLongsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public DivUnsignedLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModDoublesEvaluator.java index 0698e816d8a86..7abb9cdca124d 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModDoublesEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class ModDoublesEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public ModDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModIntsEvaluator.java index c1af534a07da4..4ba618a162e60 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModIntsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class ModIntsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public ModIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModLongsEvaluator.java index 295724e041211..8fb43d2968947 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class ModLongsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public ModLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModUnsignedLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModUnsignedLongsEvaluator.java index 95621fb9ef61b..664d3219e0319 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModUnsignedLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/ModUnsignedLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class ModUnsignedLongsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public ModUnsignedLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulDoublesEvaluator.java index 0a0fbebbe18d6..d5079ce565c14 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulDoublesEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class MulDoublesEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public MulDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulIntsEvaluator.java index e94d174f8249c..e5b9917c409e8 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulIntsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class MulIntsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public MulIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulLongsEvaluator.java index ffa437390fead..002793ec781d9 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class MulLongsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public MulLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulUnsignedLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulUnsignedLongsEvaluator.java index c9d1b95851ed0..fe0d1ae2f6e7b 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulUnsignedLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/MulUnsignedLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class MulUnsignedLongsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public MulUnsignedLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegDoublesEvaluator.java index 3a54d490bb003..e5d1284ade262 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegDoublesEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -19,8 +20,11 @@ public final class NegDoublesEvaluator implements EvalOperator.ExpressionEvaluator { private final EvalOperator.ExpressionEvaluator v; - public NegDoublesEvaluator(EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public NegDoublesEvaluator(EvalOperator.ExpressionEvaluator v, DriverContext driverContext) { this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegIntsEvaluator.java index aefa05097cb96..526ce41bd71d6 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegIntsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class NegIntsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator v; - public NegIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public NegIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator v, + DriverContext driverContext) { this.warnings = new Warnings(source); this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegLongsEvaluator.java index 5bd301b8f76fc..21b02d8f0783a 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -24,9 +25,13 @@ public final class NegLongsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator v; - public NegLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator v) { + private final DriverContext driverContext; + + public NegLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator v, + DriverContext driverContext) { this.warnings = new Warnings(source); this.v = v; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDatetimesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDatetimesEvaluator.java index d6e94ce2218ed..681edc68f326e 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDatetimesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDatetimesEvaluator.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -28,11 +29,14 @@ public final class SubDatetimesEvaluator implements EvalOperator.ExpressionEvalu private final TemporalAmount temporalAmount; + private final DriverContext driverContext; + public SubDatetimesEvaluator(Source source, EvalOperator.ExpressionEvaluator datetime, - TemporalAmount temporalAmount) { + TemporalAmount temporalAmount, DriverContext driverContext) { this.warnings = new Warnings(source); this.datetime = datetime; this.temporalAmount = temporalAmount; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDoublesEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDoublesEvaluator.java index c245ad03a0cea..bf69f6a7a9a81 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDoublesEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubDoublesEvaluator.java @@ -10,6 +10,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.DoubleVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; /** @@ -21,10 +22,13 @@ public final class SubDoublesEvaluator implements EvalOperator.ExpressionEvaluat private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public SubDoublesEvaluator(EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubIntsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubIntsEvaluator.java index bc942ca7522fb..8d5afb8113a99 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubIntsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubIntsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.IntVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class SubIntsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public SubIntsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubLongsEvaluator.java index 4b22842c74d8a..5f561c9778b18 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class SubLongsEvaluator implements EvalOperator.ExpressionEvaluator private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public SubLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubUnsignedLongsEvaluator.java b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubUnsignedLongsEvaluator.java index 76ae796c5205a..a30d9d973c2d8 100644 --- a/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubUnsignedLongsEvaluator.java +++ b/x-pack/plugin/esql/src/main/java/generated/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/SubUnsignedLongsEvaluator.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.LongBlock; import org.elasticsearch.compute.data.LongVector; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Warnings; import org.elasticsearch.xpack.ql.tree.Source; @@ -26,11 +27,14 @@ public final class SubUnsignedLongsEvaluator implements EvalOperator.ExpressionE private final EvalOperator.ExpressionEvaluator rhs; + private final DriverContext driverContext; + public SubUnsignedLongsEvaluator(Source source, EvalOperator.ExpressionEvaluator lhs, - EvalOperator.ExpressionEvaluator rhs) { + EvalOperator.ExpressionEvaluator rhs, DriverContext driverContext) { this.warnings = new Warnings(source); this.lhs = lhs; this.rhs = rhs; + this.driverContext = driverContext; } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/EvalMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/EvalMapper.java index 2f8f09b9ff02b..3688a0633aca9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/EvalMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/EvalMapper.java @@ -35,7 +35,6 @@ import java.util.List; import java.util.function.IntFunction; -import java.util.function.Supplier; public final class EvalMapper { @@ -59,7 +58,7 @@ public final class EvalMapper { private EvalMapper() {} @SuppressWarnings({ "rawtypes", "unchecked" }) - public static Supplier toEvaluator(Expression exp, Layout layout) { + public static ExpressionEvaluator.Factory toEvaluator(Expression exp, Layout layout) { if (exp instanceof EvaluatorMapper m) { return m.toEvaluator(e -> toEvaluator(e, layout)); } @@ -73,9 +72,9 @@ public static Supplier toEvaluator(Expression exp, Layout l static class BooleanLogic extends ExpressionMapper { @Override - public Supplier map(BinaryLogic bc, Layout layout) { - Supplier leftEval = toEvaluator(bc.left(), layout); - Supplier rightEval = toEvaluator(bc.right(), layout); + public ExpressionEvaluator.Factory map(BinaryLogic bc, Layout layout) { + var leftEval = toEvaluator(bc.left(), layout); + var rightEval = toEvaluator(bc.right(), layout); /** * Evaluator for the three-valued boolean expressions. * We can't generate these with the {@link Evaluator} annotation because that @@ -140,21 +139,24 @@ private Block eval(BooleanVector lhs, BooleanVector rhs) { } } - return () -> new BooleanLogicExpressionEvaluator(bc, leftEval.get(), rightEval.get()); + return driverContext -> new BooleanLogicExpressionEvaluator(bc, leftEval.get(driverContext), rightEval.get(driverContext)); } } static class Nots extends ExpressionMapper { @Override - public Supplier map(Not not, Layout layout) { - Supplier expEval = toEvaluator(not.field(), layout); - return () -> new org.elasticsearch.xpack.esql.evaluator.predicate.operator.logical.NotEvaluator(expEval.get()); + public ExpressionEvaluator.Factory map(Not not, Layout layout) { + var expEval = toEvaluator(not.field(), layout); + return dvrCtx -> new org.elasticsearch.xpack.esql.evaluator.predicate.operator.logical.NotEvaluator( + expEval.get(dvrCtx), + dvrCtx + ); } } static class Attributes extends ExpressionMapper { @Override - public Supplier map(Attribute attr, Layout layout) { + public ExpressionEvaluator.Factory map(Attribute attr, Layout layout) { record Attribute(int channel) implements ExpressionEvaluator { @Override public Block eval(Page page) { @@ -162,14 +164,14 @@ public Block eval(Page page) { } } int channel = layout.get(attr.id()).channel(); - return () -> new Attribute(channel); + return driverContext -> new Attribute(channel); } } static class Literals extends ExpressionMapper { @Override - public Supplier map(Literal lit, Layout layout) { + public ExpressionEvaluator.Factory map(Literal lit, Layout layout) { record LiteralsEvaluator(IntFunction block) implements ExpressionEvaluator { @Override public Block eval(Page page) { @@ -188,7 +190,7 @@ public String toString() { return lit.toString(); } }; - return () -> new LiteralsEvaluator(blockClosure); + return driverContext -> new LiteralsEvaluator(blockClosure); } private IntFunction block(Literal lit) { @@ -214,9 +216,9 @@ private IntFunction block(Literal lit) { static class IsNulls extends ExpressionMapper { @Override - public Supplier map(IsNull isNull, Layout layout) { - Supplier field = toEvaluator(isNull.field(), layout); - return () -> new IsNullEvaluator(field.get()); + public ExpressionEvaluator.Factory map(IsNull isNull, Layout layout) { + var field = toEvaluator(isNull.field(), layout); + return driverContext -> new IsNullEvaluator(field.get(driverContext)); } record IsNullEvaluator(EvalOperator.ExpressionEvaluator field) implements EvalOperator.ExpressionEvaluator { @@ -238,9 +240,9 @@ public Block eval(Page page) { static class IsNotNulls extends ExpressionMapper { @Override - public Supplier map(IsNotNull isNotNull, Layout layout) { - Supplier field = toEvaluator(isNotNull.field(), layout); - return () -> new IsNotNullEvaluator(field.get()); + public ExpressionEvaluator.Factory map(IsNotNull isNotNull, Layout layout) { + var field = toEvaluator(isNotNull.field(), layout); + return driverContext -> new IsNotNullEvaluator(field.get(driverContext)); } record IsNotNullEvaluator(EvalOperator.ExpressionEvaluator field) implements EvalOperator.ExpressionEvaluator { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/EvaluatorMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/EvaluatorMapper.java index d15aa0e28871b..aa4d9235bdb40 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/EvaluatorMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/EvaluatorMapper.java @@ -8,11 +8,11 @@ package org.elasticsearch.xpack.esql.evaluator.mapper; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.ql.expression.Expression; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.compute.data.BlockUtils.fromArrayRow; import static org.elasticsearch.compute.data.BlockUtils.toJavaObject; @@ -21,7 +21,7 @@ * Expressions that have a mapping to an {@link ExpressionEvaluator}. */ public interface EvaluatorMapper { - Supplier toEvaluator(Function> toEvaluator); + ExpressionEvaluator.Factory toEvaluator(Function toEvaluator); /** * Fold using {@link #toEvaluator} so you don't need a "by hand" @@ -30,6 +30,9 @@ public interface EvaluatorMapper { * good enough. */ default Object fold() { - return toJavaObject(toEvaluator(e -> () -> p -> fromArrayRow(e.fold())[0]).get().eval(new Page(1)), 0); + return toJavaObject( + toEvaluator(e -> driverContext -> p -> fromArrayRow(e.fold())[0]).get(DriverContext.DEFAULT).eval(new Page(1)), + 0 + ); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/ExpressionMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/ExpressionMapper.java index b574bb08eeea5..9657fd0c6ffc0 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/ExpressionMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/mapper/ExpressionMapper.java @@ -7,13 +7,11 @@ package org.elasticsearch.xpack.esql.evaluator.mapper; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.planner.Layout; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.util.ReflectionUtils; -import java.util.function.Supplier; - public abstract class ExpressionMapper { public final Class typeToken; @@ -21,5 +19,5 @@ public ExpressionMapper() { typeToken = ReflectionUtils.detectSuperTypeForRuleLike(getClass()); } - public abstract Supplier map(E expression, Layout layout); + public abstract ExpressionEvaluator.Factory map(E expression, Layout layout); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/ComparisonMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/ComparisonMapper.java index 592a9f3d99499..cb10499ae6d0b 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/ComparisonMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/ComparisonMapper.java @@ -8,7 +8,9 @@ package org.elasticsearch.xpack.esql.evaluator.predicate.operator.comparison; import org.elasticsearch.common.TriFunction; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.ExpressionMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.math.Cast; @@ -20,9 +22,6 @@ import org.elasticsearch.xpack.ql.type.DataType; import org.elasticsearch.xpack.ql.type.DataTypes; -import java.util.function.BiFunction; -import java.util.function.Supplier; - import static org.elasticsearch.xpack.esql.evaluator.EvalMapper.toEvaluator; public abstract class ComparisonMapper extends ExpressionMapper { @@ -76,18 +75,18 @@ public abstract class ComparisonMapper extends Expre ) { }; - private final BiFunction ints; - private final BiFunction longs; - private final BiFunction doubles; - private final BiFunction keywords; - private final BiFunction bools; + private final TriFunction ints; + private final TriFunction longs; + private final TriFunction doubles; + private final TriFunction keywords; + private final TriFunction bools; private ComparisonMapper( - BiFunction ints, - BiFunction longs, - BiFunction doubles, - BiFunction keywords, - BiFunction bools + TriFunction ints, + TriFunction longs, + TriFunction doubles, + TriFunction keywords, + TriFunction bools ) { this.ints = ints; this.longs = longs; @@ -97,20 +96,20 @@ private ComparisonMapper( } ComparisonMapper( - BiFunction ints, - BiFunction longs, - BiFunction doubles, - BiFunction keywords + TriFunction ints, + TriFunction longs, + TriFunction doubles, + TriFunction keywords ) { this.ints = ints; this.longs = longs; this.doubles = doubles; this.keywords = keywords; - this.bools = (lhs, rhs) -> { throw EsqlIllegalArgumentException.illegalDataType(DataTypes.BOOLEAN); }; + this.bools = (lhs, rhs, dvrCtx) -> { throw EsqlIllegalArgumentException.illegalDataType(DataTypes.BOOLEAN); }; } @Override - public final Supplier map(BinaryComparison bc, Layout layout) { + public final ExpressionEvaluator.Factory map(BinaryComparison bc, Layout layout) { DataType leftType = bc.left().dataType(); if (leftType.isNumeric()) { DataType type = EsqlDataTypeRegistry.INSTANCE.commonType(leftType, bc.right().dataType()); @@ -128,32 +127,32 @@ public final Supplier map(BinaryComparison bc, return castToEvaluator(bc, layout, DataTypes.UNSIGNED_LONG, longs); } } - Supplier leftEval = toEvaluator(bc.left(), layout); - Supplier rightEval = toEvaluator(bc.right(), layout); + var leftEval = toEvaluator(bc.left(), layout); + var rightEval = toEvaluator(bc.right(), layout); if (leftType == DataTypes.KEYWORD || leftType == DataTypes.TEXT || leftType == DataTypes.IP || leftType == DataTypes.VERSION) { - return () -> keywords.apply(leftEval.get(), rightEval.get()); + return dvrCtx -> keywords.apply(leftEval.get(dvrCtx), rightEval.get(dvrCtx), dvrCtx); } if (leftType == DataTypes.BOOLEAN) { - return () -> bools.apply(leftEval.get(), rightEval.get()); + return dvrCtx -> bools.apply(leftEval.get(dvrCtx), rightEval.get(dvrCtx), dvrCtx); } if (leftType == DataTypes.DATETIME) { - return () -> longs.apply(leftEval.get(), rightEval.get()); + return dvrCtx -> longs.apply(leftEval.get(dvrCtx), rightEval.get(dvrCtx), dvrCtx); } throw new EsqlIllegalArgumentException("resolved type for [" + bc + "] but didn't implement mapping"); } - public static Supplier castToEvaluator( + public static ExpressionEvaluator.Factory castToEvaluator( BinaryOperator op, Layout layout, DataType required, - BiFunction buildEvaluator + TriFunction buildEvaluator ) { - Supplier lhs = Cast.cast(op.left().dataType(), required, toEvaluator(op.left(), layout)); - Supplier rhs = Cast.cast(op.right().dataType(), required, toEvaluator(op.right(), layout)); - return () -> buildEvaluator.apply(lhs.get(), rhs.get()); + var lhs = Cast.cast(op.left().dataType(), required, toEvaluator(op.left(), layout)); + var rhs = Cast.cast(op.right().dataType(), required, toEvaluator(op.right(), layout)); + return dvrCtx -> buildEvaluator.apply(lhs.get(dvrCtx), rhs.get(dvrCtx), dvrCtx); } - public static Supplier castToEvaluator( + public static ExpressionEvaluator.Factory castToEvaluatorWithSource( BinaryOperator op, Layout layout, DataType required, @@ -163,8 +162,8 @@ public static Supplier castToEvaluator( EvalOperator.ExpressionEvaluator, EvalOperator.ExpressionEvaluator> buildEvaluator ) { - Supplier lhs = Cast.cast(op.left().dataType(), required, toEvaluator(op.left(), layout)); - Supplier rhs = Cast.cast(op.right().dataType(), required, toEvaluator(op.right(), layout)); - return () -> buildEvaluator.apply(op.source(), lhs.get(), rhs.get()); + var lhs = Cast.cast(op.left().dataType(), required, toEvaluator(op.left(), layout)); + var rhs = Cast.cast(op.right().dataType(), required, toEvaluator(op.right(), layout)); + return dvrCtx -> buildEvaluator.apply(op.source(), lhs.get(dvrCtx), rhs.get(dvrCtx)); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/InMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/InMapper.java index b99cccab54ba3..89df014a73705 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/InMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/comparison/InMapper.java @@ -15,6 +15,7 @@ import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.data.Vector; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.ExpressionMapper; import org.elasticsearch.xpack.esql.expression.predicate.operator.comparison.In; import org.elasticsearch.xpack.esql.planner.Layout; @@ -22,7 +23,6 @@ import java.util.ArrayList; import java.util.BitSet; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.esql.evaluator.predicate.operator.comparison.ComparisonMapper.EQUALS; @@ -34,14 +34,14 @@ private InMapper() {} @SuppressWarnings({ "rawtypes", "unchecked" }) @Override - public Supplier map(In in, Layout layout) { - List> listEvaluators = new ArrayList<>(in.list().size()); + public ExpressionEvaluator.Factory map(In in, Layout layout) { + List listEvaluators = new ArrayList<>(in.list().size()); in.list().forEach(e -> { Equals eq = new Equals(in.source(), in.value(), e); - Supplier eqEvaluator = ((ExpressionMapper) EQUALS).map(eq, layout); + ExpressionEvaluator.Factory eqEvaluator = ((ExpressionMapper) EQUALS).map(eq, layout); listEvaluators.add(eqEvaluator); }); - return () -> new InExpressionEvaluator(listEvaluators.stream().map(Supplier::get).toList()); + return dvrCtx -> new InExpressionEvaluator(listEvaluators.stream().map(fac -> fac.get(dvrCtx)).toList()); } record InExpressionEvaluator(List listEvaluators) implements EvalOperator.ExpressionEvaluator { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMapper.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMapper.java index 4adecf0cf7109..c0fa71a59e415 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMapper.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/evaluator/predicate/operator/regex/RegexMapper.java @@ -8,23 +8,22 @@ package org.elasticsearch.xpack.esql.evaluator.predicate.operator.regex; import org.apache.lucene.util.automaton.CharacterRunAutomaton; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.EvalMapper; import org.elasticsearch.xpack.esql.evaluator.mapper.ExpressionMapper; import org.elasticsearch.xpack.esql.planner.Layout; import org.elasticsearch.xpack.ql.expression.predicate.regex.AbstractStringPattern; import org.elasticsearch.xpack.ql.expression.predicate.regex.RegexMatch; -import java.util.function.Supplier; - public abstract class RegexMapper extends ExpressionMapper> { public static final ExpressionMapper REGEX_MATCH = new RegexMapper() { @Override - public Supplier map(RegexMatch expression, Layout layout) { - return () -> new org.elasticsearch.xpack.esql.evaluator.predicate.operator.regex.RegexMatchEvaluator( - EvalMapper.toEvaluator(expression.field(), layout).get(), - new CharacterRunAutomaton(((AbstractStringPattern) expression.pattern()).createAutomaton()) + public ExpressionEvaluator.Factory map(RegexMatch expression, Layout layout) { + return dvrCtx -> new org.elasticsearch.xpack.esql.evaluator.predicate.operator.regex.RegexMatchEvaluator( + EvalMapper.toEvaluator(expression.field(), layout).get(dvrCtx), + new CharacterRunAutomaton(((AbstractStringPattern) expression.pattern()).createAutomaton()), + dvrCtx ); } }; diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java index 88610bb989c35..fd8c400b834f0 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Case.java @@ -11,7 +11,9 @@ import org.elasticsearch.compute.data.BooleanBlock; import org.elasticsearch.compute.data.ElementType; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; import org.elasticsearch.xpack.ql.expression.Expression; @@ -27,7 +29,6 @@ import java.util.ArrayList; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import java.util.stream.IntStream; import java.util.stream.Stream; @@ -151,27 +152,25 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + List conditionsEval = conditions.stream() .map(c -> new ConditionEvaluatorSupplier(toEvaluator.apply(c.condition), toEvaluator.apply(c.value))) .toList(); - Supplier elseValueEval = toEvaluator.apply(elseValue); - return () -> new CaseEvaluator( + var elseValueEval = toEvaluator.apply(elseValue); + return dvrCtx -> new CaseEvaluator( LocalExecutionPlanner.toElementType(dataType()), - conditionsEval.stream().map(Supplier::get).toList(), - elseValueEval.get() + conditionsEval.stream().map(x -> x.apply(dvrCtx)).toList(), + elseValueEval.get(dvrCtx) ); } - record ConditionEvaluatorSupplier( - Supplier condition, - Supplier value - ) implements Supplier { + record ConditionEvaluatorSupplier(ExpressionEvaluator.Factory condition, ExpressionEvaluator.Factory value) + implements + Function { @Override - public ConditionEvaluator get() { - return new ConditionEvaluator(condition.get(), value.get()); + public ConditionEvaluator apply(DriverContext driverContext) { + return new ConditionEvaluator(condition.get(driverContext), value.get(driverContext)); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java index b0561915e70a0..279262f72e1c2 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Greatest.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; @@ -31,7 +32,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import java.util.stream.Stream; import static org.elasticsearch.xpack.ql.type.DataTypes.NULL; @@ -106,29 +106,42 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - List> evaluatorSuppliers = children().stream().map(toEvaluator).toList(); - Supplier> suppliers = () -> evaluatorSuppliers.stream().map(Supplier::get); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var suppliers = children().stream().map(toEvaluator).toList(); if (dataType == DataTypes.BOOLEAN) { - return () -> new GreatestBooleanEvaluator( - suppliers.get().map(MvMaxBooleanEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new GreatestBooleanEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMaxBooleanEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.DOUBLE) { - return () -> new GreatestDoubleEvaluator( - suppliers.get().map(MvMaxDoubleEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new GreatestDoubleEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMaxDoubleEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.INTEGER) { - return () -> new GreatestIntEvaluator( - suppliers.get().map(MvMaxIntEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new GreatestIntEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMaxIntEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.LONG) { - return () -> new GreatestLongEvaluator( - suppliers.get().map(MvMaxLongEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new GreatestLongEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMaxLongEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.KEYWORD @@ -137,8 +150,12 @@ public Supplier toEvaluator( || dataType == DataTypes.VERSION || dataType == DataTypes.UNSUPPORTED) { - return () -> new GreatestBytesRefEvaluator( - suppliers.get().map(MvMaxBytesRefEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new GreatestBytesRefEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMaxBytesRefEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } throw EsqlIllegalArgumentException.illegalDataType(dataType); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java index 2871b2c54cac3..14d938f454160 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/Least.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; @@ -31,7 +32,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import java.util.stream.Stream; import static org.elasticsearch.xpack.ql.type.DataTypes.NULL; @@ -106,29 +106,42 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - List> evaluatorSuppliers = children().stream().map(toEvaluator).toList(); - Supplier> suppliers = () -> evaluatorSuppliers.stream().map(Supplier::get); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var suppliers = children().stream().map(toEvaluator).toList(); if (dataType == DataTypes.BOOLEAN) { - return () -> new LeastBooleanEvaluator( - suppliers.get().map(MvMinBooleanEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new LeastBooleanEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMinBooleanEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.DOUBLE) { - return () -> new LeastDoubleEvaluator( - suppliers.get().map(MvMinDoubleEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new LeastDoubleEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMinDoubleEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.INTEGER) { - return () -> new LeastIntEvaluator( - suppliers.get().map(MvMinIntEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new LeastIntEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMinIntEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.LONG) { - return () -> new LeastLongEvaluator( - suppliers.get().map(MvMinLongEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new LeastLongEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMinLongEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } if (dataType == DataTypes.KEYWORD @@ -137,8 +150,12 @@ public Supplier toEvaluator( || dataType == DataTypes.VERSION || dataType == DataTypes.UNSUPPORTED) { - return () -> new LeastBytesRefEvaluator( - suppliers.get().map(MvMinBytesRefEvaluator::new).toArray(EvalOperator.ExpressionEvaluator[]::new) + return dvrCtx -> new LeastBytesRefEvaluator( + suppliers.stream() + .map(es -> es.get(dvrCtx)) + .map(ev -> new MvMinBytesRefEvaluator(ev, dvrCtx)) + .toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } throw EsqlIllegalArgumentException.illegalDataType(dataType); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java index 0360397e419b0..257ae59d5f8b1 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/convert/AbstractConvertFunction.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.data.Vector; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Warnings; @@ -24,7 +25,7 @@ import java.util.Locale; import java.util.Map; import java.util.function.BiFunction; -import java.util.function.Supplier; +import java.util.function.Function; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -40,13 +41,13 @@ protected AbstractConvertFunction(Source source, Expression field) { /** * Build the evaluator given the evaluator a multivalued field. */ - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { DataType sourceType = field().dataType(); var evaluator = evaluators().get(sourceType); if (evaluator == null) { throw EsqlIllegalArgumentException.illegalDataType(sourceType); } - return () -> evaluator.apply(fieldEval.get(), source()); + return dvrCtx -> evaluator.apply(fieldEval.get(dvrCtx), source()); } @Override @@ -71,9 +72,7 @@ public final Object fold() { } @Override - public final Supplier toEvaluator( - java.util.function.Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { return evaluator(toEvaluator.apply(field())); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtract.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtract.java index 3e9f84c2c67a1..66dbb1dd33901 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtract.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateExtract.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.lucene.BytesRefs; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; @@ -30,7 +30,6 @@ import java.util.List; import java.util.Locale; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isDate; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isStringAndExact; @@ -44,20 +43,24 @@ public DateExtract(Source source, Expression field, Expression chronoFieldExp, C } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier fieldEvaluator = toEvaluator.apply(children().get(0)); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var fieldEvaluator = toEvaluator.apply(children().get(0)); if (children().get(1).foldable()) { ChronoField chrono = chronoField(); if (chrono == null) { BytesRef field = (BytesRef) children().get(1).fold(); throw new EsqlIllegalArgumentException("invalid date field for [{}]: {}", sourceText(), field.utf8ToString()); } - return () -> new DateExtractConstantEvaluator(fieldEvaluator.get(), chrono, configuration().zoneId()); + return dvrCtx -> new DateExtractConstantEvaluator(fieldEvaluator.get(dvrCtx), chrono, configuration().zoneId(), dvrCtx); } - Supplier chronoEvaluator = toEvaluator.apply(children().get(1)); - return () -> new DateExtractEvaluator(source(), fieldEvaluator.get(), chronoEvaluator.get(), configuration().zoneId()); + var chronoEvaluator = toEvaluator.apply(children().get(1)); + return dvrCtx -> new DateExtractEvaluator( + source(), + fieldEvaluator.get(dvrCtx), + chronoEvaluator.get(dvrCtx), + configuration().zoneId(), + dvrCtx + ); } private ChronoField chronoField() { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormat.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormat.java index cc1f649cff730..82da590db7ece 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormat.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateFormat.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.session.EsqlConfiguration; import org.elasticsearch.xpack.ql.expression.Expression; @@ -28,7 +28,6 @@ import java.util.List; import java.util.Locale; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -93,22 +92,25 @@ static BytesRef process(long val, BytesRef formatter, @Fixed Locale locale) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier fieldEvaluator = toEvaluator.apply(field); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var fieldEvaluator = toEvaluator.apply(field); if (format == null) { - return () -> new DateFormatConstantEvaluator(fieldEvaluator.get(), UTC_DATE_TIME_FORMATTER); + return dvrCtx -> new DateFormatConstantEvaluator(fieldEvaluator.get(dvrCtx), UTC_DATE_TIME_FORMATTER, dvrCtx); } if (format.dataType() != DataTypes.KEYWORD) { throw new IllegalArgumentException("unsupported data type for format [" + format.dataType() + "]"); } if (format.foldable()) { DateFormatter formatter = toFormatter(format.fold(), ((EsqlConfiguration) configuration()).locale()); - return () -> new DateFormatConstantEvaluator(fieldEvaluator.get(), formatter); + return dvrCtx -> new DateFormatConstantEvaluator(fieldEvaluator.get(dvrCtx), formatter, dvrCtx); } - Supplier formatEvaluator = toEvaluator.apply(format); - return () -> new DateFormatEvaluator(fieldEvaluator.get(), formatEvaluator.get(), ((EsqlConfiguration) configuration()).locale()); + var formatEvaluator = toEvaluator.apply(format); + return dvrCtx -> new DateFormatEvaluator( + fieldEvaluator.get(dvrCtx), + formatEvaluator.get(dvrCtx), + ((EsqlConfiguration) configuration()).locale(), + dvrCtx + ); } private static DateFormatter toFormatter(Object format, Locale locale) { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParse.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParse.java index 5d69b8d7f2219..98d75cbf672df 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParse.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateParse.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.time.DateFormatter; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; @@ -27,7 +27,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.common.time.DateFormatter.forPattern; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; @@ -95,13 +94,11 @@ static long process(BytesRef val, BytesRef formatter, @Fixed ZoneId zoneId) thro } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { ZoneId zone = UTC; // TODO session timezone? - Supplier fieldEvaluator = toEvaluator.apply(field); + ExpressionEvaluator.Factory fieldEvaluator = toEvaluator.apply(field); if (format == null) { - return () -> new DateParseConstantEvaluator(source(), fieldEvaluator.get(), DEFAULT_FORMATTER); + return dvrCtx -> new DateParseConstantEvaluator(source(), fieldEvaluator.get(dvrCtx), DEFAULT_FORMATTER, dvrCtx); } if (format.dataType() != DataTypes.KEYWORD) { throw new IllegalArgumentException("unsupported data type for date_parse [" + format.dataType() + "]"); @@ -109,13 +106,13 @@ public Supplier toEvaluator( if (format.foldable()) { try { DateFormatter formatter = toFormatter(format.fold(), zone); - return () -> new DateParseConstantEvaluator(source(), fieldEvaluator.get(), formatter); + return dvrCtx -> new DateParseConstantEvaluator(source(), fieldEvaluator.get(dvrCtx), formatter, dvrCtx); } catch (IllegalArgumentException e) { throw new EsqlIllegalArgumentException(e, "invalid date pattern for [{}]: {}", sourceText(), e.getMessage()); } } - Supplier formatEvaluator = toEvaluator.apply(format); - return () -> new DateParseEvaluator(source(), fieldEvaluator.get(), formatEvaluator.get(), zone); + ExpressionEvaluator.Factory formatEvaluator = toEvaluator.apply(format); + return dvrCtx -> new DateParseEvaluator(source(), fieldEvaluator.get(dvrCtx), formatEvaluator.get(dvrCtx), zone, dvrCtx); } private static DateFormatter toFormatter(Object format, ZoneId zone) { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTrunc.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTrunc.java index e2c8dc5b6d85f..d7964e6c011fd 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTrunc.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/DateTrunc.java @@ -10,7 +10,7 @@ import org.elasticsearch.common.Rounding; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.core.TimeValue; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; @@ -25,7 +25,6 @@ import java.time.ZoneId; import java.util.concurrent.TimeUnit; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.common.logging.LoggerMessageFormat.format; import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isTemporalAmount; @@ -152,10 +151,8 @@ private static Rounding.Prepared createRounding(final Duration duration, final Z } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier fieldEvaluator = toEvaluator.apply(timestampField()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var fieldEvaluator = toEvaluator.apply(timestampField()); Expression interval = interval(); if (interval.foldable() == false) { throw new IllegalArgumentException("Function [" + sourceText() + "] has invalid interval [" + interval().sourceText() + "]."); @@ -174,10 +171,7 @@ public Supplier toEvaluator( return evaluator(fieldEvaluator, DateTrunc.createRounding(foldedInterval, zoneId())); } - public static Supplier evaluator( - Supplier fieldEvaluator, - Rounding.Prepared rounding - ) { - return () -> new DateTruncEvaluator(fieldEvaluator.get(), rounding); + public static ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEvaluator, Rounding.Prepared rounding) { + return dvrCtx -> new DateTruncEvaluator(fieldEvaluator.get(dvrCtx), rounding, dvrCtx); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/Now.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/Now.java index 2695177c7456a..1cf56a2f764ca 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/Now.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/date/Now.java @@ -9,7 +9,7 @@ import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.function.scalar.ConfigurationFunction; @@ -22,7 +22,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; public class Now extends ConfigurationFunction implements EvaluatorMapper { @@ -73,10 +72,8 @@ protected NodeInfo info() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - return () -> new NowEvaluator(now); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + return dvrCtx -> new NowEvaluator(now, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatch.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatch.java index 1eed641f72354..36d889ea1b19a 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatch.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/ip/CIDRMatch.java @@ -11,6 +11,7 @@ import org.elasticsearch.common.network.CIDRUtils; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.function.scalar.ScalarFunction; @@ -24,7 +25,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static java.util.Collections.singletonList; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; @@ -55,13 +55,12 @@ public CIDRMatch(Source source, Expression ipField, List matches) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier ipEvaluatorSupplier = toEvaluator.apply(ipField); - return () -> new CIDRMatchEvaluator( - ipEvaluatorSupplier.get(), - matches.stream().map(x -> toEvaluator.apply(x).get()).toArray(EvalOperator.ExpressionEvaluator[]::new) + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var ipEvaluatorSupplier = toEvaluator.apply(ipField); + return dvrCtx -> new CIDRMatchEvaluator( + ipEvaluatorSupplier.get(dvrCtx), + matches.stream().map(x -> toEvaluator.apply(x).get(dvrCtx)).toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Abs.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Abs.java index 0d2c2f812a0bf..92b023792cb6f 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Abs.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Abs.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; @@ -20,7 +20,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; public class Abs extends UnaryScalarFunction implements EvaluatorMapper { public Abs(Source source, @Named("n") Expression n) { @@ -48,21 +47,19 @@ static int process(int fieldVal) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); if (dataType() == DataTypes.DOUBLE) { - return () -> new AbsDoubleEvaluator(field.get()); + return dvrCtx -> new AbsDoubleEvaluator(field.get(dvrCtx), dvrCtx); } if (dataType() == DataTypes.UNSIGNED_LONG) { return field; } if (dataType() == DataTypes.LONG) { - return () -> new AbsLongEvaluator(field.get()); + return dvrCtx -> new AbsLongEvaluator(field.get(dvrCtx), dvrCtx); } if (dataType() == DataTypes.INTEGER) { - return () -> new AbsIntEvaluator(field.get()); + return dvrCtx -> new AbsIntEvaluator(field.get(dvrCtx), dvrCtx); } throw EsqlIllegalArgumentException.illegalDataType(dataType()); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbstractTrigonometricFunction.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbstractTrigonometricFunction.java index cd7c01832d543..400118a1f7edf 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbstractTrigonometricFunction.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AbstractTrigonometricFunction.java @@ -7,7 +7,9 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; import org.elasticsearch.xpack.ql.expression.Expression; @@ -16,7 +18,6 @@ import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric; @@ -29,14 +30,12 @@ abstract class AbstractTrigonometricFunction extends UnaryScalarFunction impleme super(source, field); } - protected abstract EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field); + protected abstract EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrDtx); @Override - public final Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier fieldEval = Cast.cast(field().dataType(), DataTypes.DOUBLE, toEvaluator.apply(field())); - return () -> doubleEvaluator(fieldEval.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var fieldEval = Cast.cast(field().dataType(), DataTypes.DOUBLE, toEvaluator.apply(field())); + return dvrCtx -> doubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Acos.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Acos.java index c81d6d0dbea46..74d8547cef35b 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Acos.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Acos.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Acos(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new AcosEvaluator(source(), field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new AcosEvaluator(source(), field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Asin.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Asin.java index c40b1b0004f5b..3c508ac3bc7da 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Asin.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Asin.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Asin(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new AsinEvaluator(source(), field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new AsinEvaluator(source(), field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan.java index 7cacd88495764..c332f4d7618ca 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Atan(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new AtanEvaluator(field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new AtanEvaluator(field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2.java index 103c6f77f0ac2..48515ecea1ae4 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Atan2.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -23,7 +23,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric; @@ -79,12 +78,10 @@ public boolean foldable() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier yEval = Cast.cast(y.dataType(), DataTypes.DOUBLE, toEvaluator.apply(y)); - Supplier xEval = Cast.cast(x.dataType(), DataTypes.DOUBLE, toEvaluator.apply(x)); - return () -> new Atan2Evaluator(yEval.get(), xEval.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var yEval = Cast.cast(y.dataType(), DataTypes.DOUBLE, toEvaluator.apply(y)); + var xEval = Cast.cast(x.dataType(), DataTypes.DOUBLE, toEvaluator.apply(x)); + return dvrCtx -> new Atan2Evaluator(yEval.get(dvrCtx), xEval.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java index 321699b06a0f6..3aaca5f53e8d0 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/AutoBucket.java @@ -9,7 +9,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.Rounding; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.core.TimeValue; import org.elasticsearch.index.mapper.DateFieldMapper; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; @@ -30,7 +30,6 @@ import java.util.List; import java.util.function.BiFunction; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FOURTH; @@ -101,9 +100,7 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { int b = ((Number) buckets.fold()).intValue(); if (field.dataType() == DataTypes.DATETIME) { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cast.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cast.java index cfe8acc1641dc..cbc40d0c2e73e 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cast.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cast.java @@ -9,54 +9,48 @@ import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.data.Block; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.ql.QlIllegalArgumentException; import org.elasticsearch.xpack.ql.type.DataType; import org.elasticsearch.xpack.ql.type.DataTypes; -import java.util.function.Supplier; - import static org.elasticsearch.xpack.ql.util.NumericUtils.unsignedLongToDouble; public class Cast { /** * Build the evaluator supplier to cast {@code in} from {@code current} to {@code required}. */ - public static Supplier cast( - DataType current, - DataType required, - Supplier in - ) { + public static ExpressionEvaluator.Factory cast(DataType current, DataType required, ExpressionEvaluator.Factory in) { if (current == required) { return in; } if (current == DataTypes.NULL || required == DataTypes.NULL) { - return () -> page -> Block.constantNullBlock(page.getPositionCount()); + return dvrCtx -> page -> Block.constantNullBlock(page.getPositionCount()); } if (required == DataTypes.DOUBLE) { if (current == DataTypes.LONG) { - return () -> new CastLongToDoubleEvaluator(in.get()); + return dvrCtx -> new CastLongToDoubleEvaluator(in.get(dvrCtx), dvrCtx); } if (current == DataTypes.INTEGER) { - return () -> new CastIntToDoubleEvaluator(in.get()); + return dvrCtx -> new CastIntToDoubleEvaluator(in.get(dvrCtx), dvrCtx); } if (current == DataTypes.UNSIGNED_LONG) { - return () -> new CastUnsignedLongToDoubleEvaluator(in.get()); + return dvrCtx -> new CastUnsignedLongToDoubleEvaluator(in.get(dvrCtx), dvrCtx); } throw cantCast(current, required); } if (required == DataTypes.UNSIGNED_LONG) { if (current == DataTypes.LONG) { - return () -> new CastLongToUnsignedLongEvaluator(in.get()); + return dvrCtx -> new CastLongToUnsignedLongEvaluator(in.get(dvrCtx), dvrCtx); } if (current == DataTypes.INTEGER) { - return () -> new CastIntToUnsignedLongEvaluator(in.get()); + return dvrCtx -> new CastIntToUnsignedLongEvaluator(in.get(dvrCtx), dvrCtx); } } if (required == DataTypes.LONG) { if (current == DataTypes.INTEGER) { - return () -> new CastIntToLongEvaluator(in.get()); + return dvrCtx -> new CastIntToLongEvaluator(in.get(dvrCtx), dvrCtx); } throw cantCast(current, required); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Ceil.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Ceil.java index 097a4e3086e1f..e23c34e506bc1 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Ceil.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Ceil.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; @@ -18,7 +18,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric; @@ -36,14 +35,12 @@ public Ceil(Source source, @Named("n") Expression n) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { if (dataType().isInteger()) { return toEvaluator.apply(field()); } - Supplier fieldEval = toEvaluator.apply(field()); - return () -> new CeilDoubleEvaluator(fieldEval.get()); + var fieldEval = toEvaluator.apply(field()); + return dvrCtx -> new CeilDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cos.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cos.java index 90a54ea5de06b..03e52d22dd4e8 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cos.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cos.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Cos(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new CosEvaluator(field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new CosEvaluator(field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cosh.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cosh.java index 0652509a78144..e19741ffd4419 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cosh.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Cosh.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Cosh(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new CoshEvaluator(source(), field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new CoshEvaluator(source(), field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Floor.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Floor.java index 7624bf7a1db77..1561113b684d0 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Floor.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Floor.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; @@ -18,7 +18,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric; @@ -36,14 +35,12 @@ public Floor(Source source, @Named("n") Expression n) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { if (dataType().isInteger()) { return toEvaluator.apply(field()); } - Supplier fieldEval = toEvaluator.apply(field()); - return () -> new FloorDoubleEvaluator(fieldEval.get()); + var fieldEval = toEvaluator.apply(field()); + return dvrCtx -> new FloorDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFinite.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFinite.java index 0db8a3b98189c..4d73516f2399c 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFinite.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsFinite.java @@ -8,14 +8,13 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.tree.NodeInfo; import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; public class IsFinite extends RationalUnaryPredicate { public IsFinite(Source source, Expression field) { @@ -23,11 +22,9 @@ public IsFinite(Source source, Expression field) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new IsFiniteEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new IsFiniteEvaluator(field.get(dvrCtx), dvrCtx); } @Evaluator diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfinite.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfinite.java index c5b6fce00b75d..0fb65d14eee04 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfinite.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsInfinite.java @@ -8,14 +8,13 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.tree.NodeInfo; import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; public class IsInfinite extends RationalUnaryPredicate { public IsInfinite(Source source, Expression field) { @@ -23,11 +22,9 @@ public IsInfinite(Source source, Expression field) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new IsInfiniteEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new IsInfiniteEvaluator(field.get(dvrCtx), dvrCtx); } @Evaluator diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaN.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaN.java index 81bec68372639..1b44158d9e8fc 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaN.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/IsNaN.java @@ -8,14 +8,13 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.tree.NodeInfo; import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; public class IsNaN extends RationalUnaryPredicate { public IsNaN(Source source, Expression field) { @@ -23,11 +22,9 @@ public IsNaN(Source source, Expression field) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new IsNaNEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new IsNaNEvaluator(field.get(dvrCtx), dvrCtx); } @Evaluator diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10.java index 616172f165d0b..2f90898cb9086 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Log10.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; @@ -22,7 +22,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric; @@ -33,24 +32,21 @@ public Log10(Source source, @Named("n") Expression n) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); var fieldType = field().dataType(); - var eval = field.get(); if (fieldType == DataTypes.DOUBLE) { - return () -> new Log10DoubleEvaluator(source(), eval); + return dvrCtx -> new Log10DoubleEvaluator(source(), field.get(dvrCtx), dvrCtx); } if (fieldType == DataTypes.INTEGER) { - return () -> new Log10IntEvaluator(source(), eval); + return dvrCtx -> new Log10IntEvaluator(source(), field.get(dvrCtx), dvrCtx); } if (fieldType == DataTypes.LONG) { - return () -> new Log10LongEvaluator(source(), eval); + return dvrCtx -> new Log10LongEvaluator(source(), field.get(dvrCtx), dvrCtx); } if (fieldType == DataTypes.UNSIGNED_LONG) { - return () -> new Log10UnsignedLongEvaluator(source(), eval); + return dvrCtx -> new Log10UnsignedLongEvaluator(source(), field.get(dvrCtx), dvrCtx); } throw EsqlIllegalArgumentException.illegalDataType(fieldType); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pow.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pow.java index 2408cf88c25ff..976310511d05f 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pow.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Pow.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -24,7 +24,6 @@ import java.util.List; import java.util.Objects; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.esql.expression.function.scalar.math.Cast.cast; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; @@ -165,28 +164,29 @@ public ScriptTemplate asScript() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { var baseEvaluator = toEvaluator.apply(base); var exponentEvaluator = toEvaluator.apply(exponent); if (dataType == DataTypes.DOUBLE) { - return () -> new PowDoubleEvaluator( + return dvrCtx -> new PowDoubleEvaluator( source(), - cast(base.dataType(), DataTypes.DOUBLE, baseEvaluator).get(), - cast(exponent.dataType(), DataTypes.DOUBLE, exponentEvaluator).get() + cast(base.dataType(), DataTypes.DOUBLE, baseEvaluator).get(dvrCtx), + cast(exponent.dataType(), DataTypes.DOUBLE, exponentEvaluator).get(dvrCtx), + dvrCtx ); } else if (dataType == DataTypes.LONG) { - return () -> new PowLongEvaluator( + return dvrCtx -> new PowLongEvaluator( source(), - cast(base.dataType(), DataTypes.DOUBLE, baseEvaluator).get(), - cast(exponent.dataType(), DataTypes.DOUBLE, exponentEvaluator).get() + cast(base.dataType(), DataTypes.DOUBLE, baseEvaluator).get(dvrCtx), + cast(exponent.dataType(), DataTypes.DOUBLE, exponentEvaluator).get(dvrCtx), + dvrCtx ); } else { - return () -> new PowIntEvaluator( + return dvrCtx -> new PowIntEvaluator( source(), - cast(base.dataType(), DataTypes.DOUBLE, baseEvaluator).get(), - cast(exponent.dataType(), DataTypes.DOUBLE, exponentEvaluator).get() + cast(base.dataType(), DataTypes.DOUBLE, baseEvaluator).get(dvrCtx), + cast(exponent.dataType(), DataTypes.DOUBLE, exponentEvaluator).get(dvrCtx), + dvrCtx ); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Round.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Round.java index 3ce830837cd5f..d2126e50abed2 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Round.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Round.java @@ -7,8 +7,10 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; +import org.elasticsearch.common.TriFunction; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.DriverContext; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; @@ -27,7 +29,6 @@ import java.util.Objects; import java.util.function.BiFunction; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -141,40 +142,38 @@ public ScriptTemplate asScript() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { DataType fieldType = dataType(); if (fieldType == DataTypes.DOUBLE) { return toEvaluator(toEvaluator, RoundDoubleNoDecimalsEvaluator::new, RoundDoubleEvaluator::new); } if (fieldType == DataTypes.INTEGER) { - return toEvaluator(toEvaluator, Function.identity(), RoundIntEvaluator::new); + return toEvaluator(toEvaluator, identity(), RoundIntEvaluator::new); } if (fieldType == DataTypes.LONG) { - return toEvaluator(toEvaluator, Function.identity(), RoundLongEvaluator::new); + return toEvaluator(toEvaluator, identity(), RoundLongEvaluator::new); } if (fieldType == DataTypes.UNSIGNED_LONG) { - return toEvaluator(toEvaluator, Function.identity(), RoundUnsignedLongEvaluator::new); + return toEvaluator(toEvaluator, identity(), RoundUnsignedLongEvaluator::new); } throw EsqlIllegalArgumentException.illegalDataType(fieldType); } - private Supplier toEvaluator( - Function> toEvaluator, - Function noDecimals, - BiFunction withDecimals + private static BiFunction identity() { + return (t, u) -> t; + } + + private ExpressionEvaluator.Factory toEvaluator( + Function toEvaluator, + BiFunction noDecimals, + TriFunction withDecimals ) { - Supplier fieldEvaluator = toEvaluator.apply(field()); + var fieldEvaluator = toEvaluator.apply(field()); if (decimals == null) { - return () -> noDecimals.apply(fieldEvaluator.get()); + return dvrCtx -> noDecimals.apply(fieldEvaluator.get(dvrCtx), dvrCtx); } - Supplier decimalsEvaluator = Cast.cast( - decimals().dataType(), - DataTypes.LONG, - toEvaluator.apply(decimals()) - ); - return () -> withDecimals.apply(fieldEvaluator.get(), decimalsEvaluator.get()); + var decimalsEvaluator = Cast.cast(decimals().dataType(), DataTypes.LONG, toEvaluator.apply(decimals())); + return dvrCtx -> withDecimals.apply(fieldEvaluator.get(dvrCtx), decimalsEvaluator.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sin.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sin.java index 2a5f709d178d2..4045eaa38e346 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sin.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sin.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Sin(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new SinEvaluator(field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new SinEvaluator(field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sinh.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sinh.java index a790b6c52c184..2a5da6775f9d2 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sinh.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sinh.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Sinh(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new SinhEvaluator(source(), field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new SinhEvaluator(source(), field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sqrt.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sqrt.java index b2386bdd9abad..6340a0735abc9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sqrt.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Sqrt.java @@ -8,7 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; @@ -22,7 +22,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isNumeric; @@ -33,24 +32,21 @@ public Sqrt(Source source, @Named("n") Expression n) { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); var fieldType = field().dataType(); - var eval = field.get(); if (fieldType == DataTypes.DOUBLE) { - return () -> new SqrtDoubleEvaluator(source(), eval); + return dvrCtx -> new SqrtDoubleEvaluator(source(), field.get(dvrCtx), dvrCtx); } if (fieldType == DataTypes.INTEGER) { - return () -> new SqrtIntEvaluator(source(), eval); + return dvrCtx -> new SqrtIntEvaluator(source(), field.get(dvrCtx), dvrCtx); } if (fieldType == DataTypes.LONG) { - return () -> new SqrtLongEvaluator(source(), eval); + return dvrCtx -> new SqrtLongEvaluator(source(), field.get(dvrCtx), dvrCtx); } if (fieldType == DataTypes.UNSIGNED_LONG) { - return () -> new SqrtUnsignedLongEvaluator(eval); + return dvrCtx -> new SqrtUnsignedLongEvaluator(field.get(dvrCtx), dvrCtx); } throw EsqlIllegalArgumentException.illegalDataType(fieldType); diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tan.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tan.java index 8a5047ac5764b..eda054b3c2051 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tan.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tan.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Tan(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new TanEvaluator(field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new TanEvaluator(field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tanh.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tanh.java index 6081ab4a1493f..65327a441103f 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tanh.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/Tanh.java @@ -8,6 +8,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.math; import org.elasticsearch.compute.ann.Evaluator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,8 +26,8 @@ public Tanh(Source source, @Named("n") Expression n) { } @Override - protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field) { - return new TanhEvaluator(field); + protected EvalOperator.ExpressionEvaluator doubleEvaluator(EvalOperator.ExpressionEvaluator field, DriverContext dvrCtx) { + return new TanhEvaluator(field, dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunction.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunction.java index 97f18b1154979..5bd3609461530 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunction.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunction.java @@ -11,13 +11,12 @@ import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.data.Vector; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.tree.Source; -import java.util.function.Supplier; - /** * Base class for functions that reduce multivalued fields into single valued fields. */ @@ -29,7 +28,7 @@ protected AbstractMultivalueFunction(Source source, Expression field) { /** * Build the evaluator given the evaluator a multivalued field. */ - protected abstract Supplier evaluator(Supplier fieldEval); + protected abstract ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval); @Override protected final TypeResolution resolveType() { @@ -47,9 +46,7 @@ public final Object fold() { } @Override - public final Supplier toEvaluator( - java.util.function.Function> toEvaluator - ) { + public final ExpressionEvaluator.Factory toEvaluator(java.util.function.Function toEvaluator) { return evaluator(toEvaluator.apply(field())); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvg.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvg.java index 8bfa48eefd9af..7930af6b25d8c 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvg.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAvg.java @@ -9,6 +9,7 @@ import org.elasticsearch.compute.ann.MvEvaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; @@ -19,7 +20,6 @@ import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isRepresentable; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -44,14 +44,14 @@ public DataType dataType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { return switch (LocalExecutionPlanner.toElementType(field().dataType())) { - case DOUBLE -> () -> new MvAvgDoubleEvaluator(fieldEval.get()); - case INT -> () -> new MvAvgIntEvaluator(fieldEval.get()); + case DOUBLE -> dvrCtx -> new MvAvgDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case INT -> dvrCtx -> new MvAvgIntEvaluator(fieldEval.get(dvrCtx), dvrCtx); case LONG -> field().dataType() == DataTypes.UNSIGNED_LONG - ? () -> new MvAvgUnsignedLongEvaluator(fieldEval.get()) - : () -> new MvAvgLongEvaluator(fieldEval.get()); - case NULL -> () -> EvalOperator.CONSTANT_NULL; + ? dvrCtx -> new MvAvgUnsignedLongEvaluator(fieldEval.get(dvrCtx), dvrCtx) + : dvrCtx -> new MvAvgLongEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case NULL -> dvrCtx -> EvalOperator.CONSTANT_NULL; default -> throw EsqlIllegalArgumentException.illegalDataType(field.dataType()); }; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcat.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcat.java index f6cf74a7f4d34..8cd8e4b3b2509 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcat.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcat.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.TypeResolutions; @@ -23,7 +24,6 @@ import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isString; @@ -55,12 +55,10 @@ public DataType dataType() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier fieldEval = toEvaluator.apply(left()); - Supplier delimEval = toEvaluator.apply(right()); - return () -> new MvConcatEvaluator(fieldEval.get(), delimEval.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var fieldEval = toEvaluator.apply(left()); + var delimEval = toEvaluator.apply(right()); + return dvrCtx -> new MvConcatEvaluator(fieldEval.get(dvrCtx), delimEval.get(dvrCtx)); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCount.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCount.java index 7aec87cf95f89..431c3f568a1db 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCount.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCount.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Vector; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.tree.NodeInfo; @@ -21,7 +22,6 @@ import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -44,8 +44,8 @@ public DataType dataType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { - return () -> new Evaluator(fieldEval.get()); + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { + return dvrCtx -> new Evaluator(fieldEval.get(dvrCtx)); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupe.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupe.java index 536e231a6956a..cec9da98d96a3 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupe.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupe.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.esql.expression.function.scalar.multivalue; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.compute.operator.MultivalueDedupe; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; @@ -16,7 +16,6 @@ import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -34,7 +33,7 @@ protected TypeResolution resolveFieldType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { return MultivalueDedupe.evaluator(LocalExecutionPlanner.toElementType(dataType()), fieldEval); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMax.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMax.java index 7aa9121dce321..5f527beef4967 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMax.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMax.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.ann.MvEvaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; @@ -18,7 +19,6 @@ import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -36,14 +36,14 @@ protected TypeResolution resolveFieldType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { return switch (LocalExecutionPlanner.toElementType(field().dataType())) { - case BOOLEAN -> () -> new MvMaxBooleanEvaluator(fieldEval.get()); - case BYTES_REF -> () -> new MvMaxBytesRefEvaluator(fieldEval.get()); - case DOUBLE -> () -> new MvMaxDoubleEvaluator(fieldEval.get()); - case INT -> () -> new MvMaxIntEvaluator(fieldEval.get()); - case LONG -> () -> new MvMaxLongEvaluator(fieldEval.get()); - case NULL -> () -> EvalOperator.CONSTANT_NULL; + case BOOLEAN -> dvrCtx -> new MvMaxBooleanEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case BYTES_REF -> dvrCtx -> new MvMaxBytesRefEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case DOUBLE -> dvrCtx -> new MvMaxDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case INT -> dvrCtx -> new MvMaxIntEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case LONG -> dvrCtx -> new MvMaxLongEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case NULL -> dvrCtx -> EvalOperator.CONSTANT_NULL; default -> throw EsqlIllegalArgumentException.illegalDataType(field.dataType()); }; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedian.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedian.java index c2916a270d830..edd68b1a45a37 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedian.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMedian.java @@ -12,7 +12,7 @@ import org.elasticsearch.compute.data.DoubleBlock; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.LongBlock; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; import org.elasticsearch.xpack.ql.expression.Expression; @@ -23,7 +23,6 @@ import java.math.BigInteger; import java.util.Arrays; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isRepresentable; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -44,13 +43,13 @@ protected TypeResolution resolveFieldType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { return switch (LocalExecutionPlanner.toElementType(field().dataType())) { - case DOUBLE -> () -> new MvMedianDoubleEvaluator(fieldEval.get()); - case INT -> () -> new MvMedianIntEvaluator(fieldEval.get()); + case DOUBLE -> dvrCtx -> new MvMedianDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case INT -> dvrCtx -> new MvMedianIntEvaluator(fieldEval.get(dvrCtx), dvrCtx); case LONG -> field().dataType() == DataTypes.UNSIGNED_LONG - ? () -> new MvMedianUnsignedLongEvaluator(fieldEval.get()) - : () -> new MvMedianLongEvaluator(fieldEval.get()); + ? dvrCtx -> new MvMedianUnsignedLongEvaluator(fieldEval.get(dvrCtx), dvrCtx) + : dvrCtx -> new MvMedianLongEvaluator(fieldEval.get(dvrCtx), dvrCtx); default -> throw EsqlIllegalArgumentException.illegalDataType(field.dataType()); }; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMin.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMin.java index c24db3d268494..2647cbfc2e0c3 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMin.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvMin.java @@ -10,6 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.ann.MvEvaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; @@ -18,7 +19,6 @@ import org.elasticsearch.xpack.ql.tree.Source; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -36,14 +36,14 @@ protected TypeResolution resolveFieldType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { return switch (LocalExecutionPlanner.toElementType(field().dataType())) { - case BOOLEAN -> () -> new MvMinBooleanEvaluator(fieldEval.get()); - case BYTES_REF -> () -> new MvMinBytesRefEvaluator(fieldEval.get()); - case DOUBLE -> () -> new MvMinDoubleEvaluator(fieldEval.get()); - case INT -> () -> new MvMinIntEvaluator(fieldEval.get()); - case LONG -> () -> new MvMinLongEvaluator(fieldEval.get()); - case NULL -> () -> EvalOperator.CONSTANT_NULL; + case BOOLEAN -> dvrCtx -> new MvMinBooleanEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case BYTES_REF -> dvrCtx -> new MvMinBytesRefEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case DOUBLE -> dvrCtx -> new MvMinDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case INT -> dvrCtx -> new MvMinIntEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case LONG -> dvrCtx -> new MvMinLongEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case NULL -> dvrCtx -> EvalOperator.CONSTANT_NULL; default -> throw EsqlIllegalArgumentException.illegalDataType(field.dataType()); }; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSum.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSum.java index 843453154b31c..858842cd78721 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSum.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvSum.java @@ -9,6 +9,7 @@ import org.elasticsearch.compute.ann.MvEvaluator; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.search.aggregations.metrics.CompensatedSum; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; @@ -18,7 +19,6 @@ import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.List; -import java.util.function.Supplier; import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isRepresentable; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isType; @@ -38,14 +38,14 @@ protected TypeResolution resolveFieldType() { } @Override - protected Supplier evaluator(Supplier fieldEval) { + protected ExpressionEvaluator.Factory evaluator(ExpressionEvaluator.Factory fieldEval) { return switch (LocalExecutionPlanner.toElementType(field().dataType())) { - case DOUBLE -> () -> new MvSumDoubleEvaluator(fieldEval.get()); - case INT -> () -> new MvSumIntEvaluator(source(), fieldEval.get()); + case DOUBLE -> dvrCtx -> new MvSumDoubleEvaluator(fieldEval.get(dvrCtx), dvrCtx); + case INT -> dvrCtx -> new MvSumIntEvaluator(source(), fieldEval.get(dvrCtx), dvrCtx); case LONG -> field().dataType() == DataTypes.UNSIGNED_LONG - ? () -> new MvSumUnsignedLongEvaluator(source(), fieldEval.get()) - : () -> new MvSumLongEvaluator(source(), fieldEval.get()); - case NULL -> () -> EvalOperator.CONSTANT_NULL; + ? dvrCtx -> new MvSumUnsignedLongEvaluator(source(), fieldEval.get(dvrCtx), dvrCtx) + : dvrCtx -> new MvSumLongEvaluator(source(), fieldEval.get(dvrCtx), dvrCtx); + case NULL -> dvrCtx -> EvalOperator.CONSTANT_NULL; default -> throw EsqlIllegalArgumentException.illegalDataType(field.dataType()); }; diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/Coalesce.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/Coalesce.java index 7730080eaf3ae..b963575826182 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/Coalesce.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/Coalesce.java @@ -11,6 +11,7 @@ import org.elasticsearch.compute.data.ElementType; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.planner.LocalExecutionPlanner; import org.elasticsearch.xpack.ql.expression.Expression; @@ -26,7 +27,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import java.util.stream.IntStream; import java.util.stream.Stream; @@ -117,13 +117,10 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - List> evaluatorSuppliers = children().stream().map(toEvaluator).toList(); - return () -> new CoalesceEvaluator( + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + return dvrCxt -> new CoalesceEvaluator( LocalExecutionPlanner.toElementType(dataType()), - evaluatorSuppliers.stream().map(Supplier::get).toList() + children().stream().map(toEvaluator).map(x -> x.get(dvrCxt)).toList() ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java index 547dfb5b9376c..4bde51fe28579 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Concat.java @@ -12,6 +12,7 @@ import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.Expressions; @@ -24,7 +25,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import java.util.stream.Stream; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; @@ -72,13 +72,12 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - List> values = children().stream().map(toEvaluator).toList(); - return () -> new ConcatEvaluator( + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var values = children().stream().map(toEvaluator).toList(); + return dvrCtx -> new ConcatEvaluator( new BytesRefBuilder(), - values.stream().map(Supplier::get).toArray(EvalOperator.ExpressionEvaluator[]::new) + values.stream().map(fac -> fac.get(dvrCtx)).toArray(EvalOperator.ExpressionEvaluator[]::new), + dvrCtx ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrim.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrim.java index eea6cbfd56d94..ffb5a3543f3f2 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrim.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LTrim.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; import org.elasticsearch.xpack.ql.expression.Expression; @@ -20,7 +20,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isString; @@ -47,11 +46,9 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new LTrimEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new LTrimEvaluator(field.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Left.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Left.java index 121225765f5af..8d129c686c9d6 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Left.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Left.java @@ -11,7 +11,7 @@ import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -69,16 +68,13 @@ static BytesRef process( } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - - Supplier strSupplier = toEvaluator.apply(str); - Supplier lengthSupplier = toEvaluator.apply(length); - return () -> { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var strSupplier = toEvaluator.apply(str); + var lengthSupplier = toEvaluator.apply(length); + return dvrCtx -> { BytesRef out = new BytesRef(); UnicodeUtil.UTF8CodePoint cp = new UnicodeUtil.UTF8CodePoint(); - return new LeftEvaluator(out, cp, strSupplier.get(), lengthSupplier.get()); + return new LeftEvaluator(out, cp, strSupplier.get(dvrCtx), lengthSupplier.get(dvrCtx), dvrCtx); }; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Length.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Length.java index b67151452dc0a..e0a1a8ed297a6 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Length.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Length.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; import org.elasticsearch.xpack.ql.expression.Expression; @@ -21,7 +21,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isString; @@ -72,10 +71,8 @@ protected NodeInfo info() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new LengthEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new LengthEvaluator(field.get(dvrCtx), dvrCtx); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrim.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrim.java index 82dbabc794013..46c8d43f0a5a7 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrim.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RTrim.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; import org.elasticsearch.xpack.ql.expression.Expression; @@ -20,7 +20,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isString; @@ -47,11 +46,9 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new RTrimEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new RTrimEvaluator(field.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Right.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Right.java index e41fb21b57797..6ab7b513d5737 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Right.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Right.java @@ -11,7 +11,7 @@ import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.Named; import org.elasticsearch.xpack.ql.expression.Expression; @@ -25,7 +25,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -73,16 +72,13 @@ static BytesRef process( } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - - Supplier strSupplier = toEvaluator.apply(str); - Supplier lengthSupplier = toEvaluator.apply(length); - return () -> { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var strSupplier = toEvaluator.apply(str); + var lengthSupplier = toEvaluator.apply(length); + return dvrCtx -> { BytesRef out = new BytesRef(); UnicodeUtil.UTF8CodePoint cp = new UnicodeUtil.UTF8CodePoint(); - return new RightEvaluator(out, cp, strSupplier.get(), lengthSupplier.get()); + return new RightEvaluator(out, cp, strSupplier.get(dvrCtx), lengthSupplier.get(dvrCtx), dvrCtx); }; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Split.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Split.java index b13f4efb25174..75d2ada1ca97b 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Split.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Split.java @@ -11,7 +11,7 @@ import org.elasticsearch.compute.ann.Evaluator; import org.elasticsearch.compute.ann.Fixed; import org.elasticsearch.compute.data.BytesRefBlock; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.QlIllegalArgumentException; import org.elasticsearch.xpack.ql.expression.Expression; @@ -22,7 +22,6 @@ import org.elasticsearch.xpack.ql.type.DataTypes; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -115,18 +114,16 @@ protected NodeInfo info() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier str = toEvaluator.apply(left()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var str = toEvaluator.apply(left()); if (right().foldable() == false) { - Supplier delim = toEvaluator.apply(right()); - return () -> new SplitVariableEvaluator(str.get(), delim.get(), new BytesRef()); + var delim = toEvaluator.apply(right()); + return dvrCtx -> new SplitVariableEvaluator(str.get(dvrCtx), delim.get(dvrCtx), new BytesRef(), dvrCtx); } BytesRef delim = (BytesRef) right().fold(); if (delim.length != 1) { throw new QlIllegalArgumentException("for now delimiter must be a single byte"); } - return () -> new SplitSingleByteEvaluator(str.get(), delim.bytes[delim.offset], new BytesRef()); + return dvrCtx -> new SplitSingleByteEvaluator(str.get(dvrCtx), delim.bytes[delim.offset], new BytesRef(), dvrCtx); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWith.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWith.java index 3018a95b7d45d..8d147f3cf9caf 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWith.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/StartsWith.java @@ -9,7 +9,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.function.scalar.ScalarFunction; @@ -22,7 +22,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -91,11 +90,9 @@ public ScriptTemplate asScript() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier strEval = toEvaluator.apply(str); - Supplier prefixEval = toEvaluator.apply(prefix); - return () -> new StartsWithEvaluator(strEval.get(), prefixEval.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var strEval = toEvaluator.apply(str); + var prefixEval = toEvaluator.apply(prefix); + return dvrCtx -> new StartsWithEvaluator(strEval.get(dvrCtx), prefixEval.get(dvrCtx), dvrCtx); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Substring.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Substring.java index cca891231fb73..9b8a6c6aa1720 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Substring.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Substring.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.ql.expression.Expression; import org.elasticsearch.xpack.ql.expression.function.OptionalArgument; @@ -24,7 +24,6 @@ import java.util.Arrays; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.FIRST; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.SECOND; @@ -132,15 +131,13 @@ public ScriptTemplate asScript() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier strSupplier = toEvaluator.apply(str); - Supplier startSupplier = toEvaluator.apply(start); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var strSupplier = toEvaluator.apply(str); + var startSupplier = toEvaluator.apply(start); if (length == null) { - return () -> new SubstringNoLengthEvaluator(strSupplier.get(), startSupplier.get()); + return dvrCtx -> new SubstringNoLengthEvaluator(strSupplier.get(dvrCtx), startSupplier.get(dvrCtx), dvrCtx); } - Supplier lengthSupplier = toEvaluator.apply(length); - return () -> new SubstringEvaluator(strSupplier.get(), startSupplier.get(), lengthSupplier.get()); + var lengthSupplier = toEvaluator.apply(length); + return dvrCtx -> new SubstringEvaluator(strSupplier.get(dvrCtx), startSupplier.get(dvrCtx), lengthSupplier.get(dvrCtx), dvrCtx); } } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Trim.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Trim.java index cdae8511a0822..f9d5febd5fc02 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Trim.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/Trim.java @@ -10,7 +10,7 @@ import org.apache.lucene.util.BytesRef; import org.apache.lucene.util.UnicodeUtil; import org.elasticsearch.compute.ann.Evaluator; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; import org.elasticsearch.xpack.esql.expression.function.scalar.UnaryScalarFunction; import org.elasticsearch.xpack.ql.expression.Expression; @@ -20,7 +20,6 @@ import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.isString; @@ -48,11 +47,9 @@ public Object fold() { } @Override - public Supplier toEvaluator( - Function> toEvaluator - ) { - Supplier field = toEvaluator.apply(field()); - return () -> new TrimEvaluator(field.get()); + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { + var field = toEvaluator.apply(field()); + return dvrCtx -> new TrimEvaluator(field.get(dvrCtx), dvrCtx); } @Override diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Add.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Add.java index 0ab7050386fb0..7da2754bfd931 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Add.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Add.java @@ -33,7 +33,7 @@ public Add(Source source, Expression left, Expression right) { AddIntsEvaluator::new, AddLongsEvaluator::new, AddUnsignedLongsEvaluator::new, - (s, l, r) -> new AddDoublesEvaluator(l, r), + (s, l, r, dvrCtx) -> new AddDoublesEvaluator(l, r, dvrCtx), AddDatetimesEvaluator::new ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DateTimeArithmeticOperation.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DateTimeArithmeticOperation.java index 01e0af5add780..3780e19a1dfd9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DateTimeArithmeticOperation.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/DateTimeArithmeticOperation.java @@ -7,7 +7,7 @@ package org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic; -import org.elasticsearch.common.TriFunction; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; import org.elasticsearch.xpack.ql.expression.Expression; @@ -18,14 +18,21 @@ import java.time.temporal.TemporalAmount; import java.util.function.Function; import java.util.function.Predicate; -import java.util.function.Supplier; import static org.elasticsearch.common.logging.LoggerMessageFormat.format; import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isDateTimeOrTemporal; abstract class DateTimeArithmeticOperation extends EsqlArithmeticOperation { - interface DatetimeArithmeticEvaluator extends TriFunction {}; + /** Arithmetic (quad) function. */ + interface DatetimeArithmeticEvaluator { + ExpressionEvaluator apply( + Source source, + ExpressionEvaluator expressionEvaluator, + TemporalAmount temporalAmount, + DriverContext driverContext + ); + } private final DatetimeArithmeticEvaluator datetimes; @@ -61,12 +68,13 @@ protected TypeResolution resolveType() { } @Override - public Supplier toEvaluator(Function> toEvaluator) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { return dataType() == DataTypes.DATETIME - ? () -> datetimes.apply( + ? dvrCtx -> datetimes.apply( source(), - toEvaluator.apply(argumentOfType(DataTypes::isDateTime)).get(), - (TemporalAmount) argumentOfType(EsqlDataTypes::isTemporalAmount).fold() + toEvaluator.apply(argumentOfType(DataTypes::isDateTime)).get(dvrCtx), + (TemporalAmount) argumentOfType(EsqlDataTypes::isTemporalAmount).fold(), + dvrCtx ) : super.toEvaluator(toEvaluator); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Div.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Div.java index ad85c6c203b10..5a89e24eb6007 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Div.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Div.java @@ -34,7 +34,7 @@ public Div(Source source, Expression left, Expression right, DataType type) { DivIntsEvaluator::new, DivLongsEvaluator::new, DivUnsignedLongsEvaluator::new, - (s, l, r) -> new DivDoublesEvaluator(l, r) + (s, l, r, dvrCtx) -> new DivDoublesEvaluator(l, r, dvrCtx) ); this.type = type; } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java index b3c5ca390100e..5a417134c96fc 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/EsqlArithmeticOperation.java @@ -7,9 +7,8 @@ package org.elasticsearch.xpack.esql.expression.predicate.operator.arithmetic; -import org.elasticsearch.common.TriFunction; import org.elasticsearch.common.io.stream.StreamOutput; -import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.xpack.esql.EsqlIllegalArgumentException; import org.elasticsearch.xpack.esql.evaluator.mapper.EvaluatorMapper; @@ -23,7 +22,6 @@ import java.io.IOException; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.ql.type.DataTypes.DOUBLE; import static org.elasticsearch.xpack.ql.type.DataTypes.INTEGER; @@ -71,7 +69,15 @@ public String symbol() { } } - interface ArithmeticEvaluator extends TriFunction {}; + /** Arithmetic (quad) function. */ + interface ArithmeticEvaluator { + ExpressionEvaluator apply( + Source source, + ExpressionEvaluator expressionEvaluator1, + ExpressionEvaluator expressionEvaluator2, + DriverContext driverContext + ); + } private final ArithmeticEvaluator ints; private final ArithmeticEvaluator longs; @@ -110,13 +116,13 @@ public DataType dataType() { } @Override - public Supplier toEvaluator(Function> toEvaluator) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { var commonType = dataType(); var leftType = left().dataType(); if (leftType.isNumeric()) { - Supplier l = Cast.cast(left().dataType(), commonType, toEvaluator.apply(left())); - Supplier r = Cast.cast(right().dataType(), commonType, toEvaluator.apply(right())); + var l = Cast.cast(left().dataType(), commonType, toEvaluator.apply(left())); + var r = Cast.cast(right().dataType(), commonType, toEvaluator.apply(right())); ArithmeticEvaluator eval; if (commonType == INTEGER) { @@ -130,7 +136,7 @@ public Supplier toEvaluator(Function eval.apply(source(), l.get(), r.get()); + return dvrCtx -> eval.apply(source(), l.get(dvrCtx), r.get(dvrCtx), dvrCtx); } throw new EsqlIllegalArgumentException("Unsupported type " + leftType); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mod.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mod.java index 8a59da3f5668c..f1aaeb1adaf14 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mod.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mod.java @@ -26,7 +26,7 @@ public Mod(Source source, Expression left, Expression right) { ModIntsEvaluator::new, ModLongsEvaluator::new, ModUnsignedLongsEvaluator::new, - (s, l, r) -> new ModDoublesEvaluator(l, r) + (s, l, r, dvrCtx) -> new ModDoublesEvaluator(l, r, dvrCtx) ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mul.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mul.java index 1583981989440..9b42cfce182b9 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mul.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Mul.java @@ -30,7 +30,7 @@ public Mul(Source source, Expression left, Expression right) { MulIntsEvaluator::new, MulLongsEvaluator::new, MulUnsignedLongsEvaluator::new, - (s, l, r) -> new MulDoublesEvaluator(l, r) + (s, l, r, dvrCtx) -> new MulDoublesEvaluator(l, r, dvrCtx) ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Neg.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Neg.java index 27a3bf362f199..0ce4b1bad6a37 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Neg.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Neg.java @@ -24,7 +24,6 @@ import java.time.Period; import java.util.List; import java.util.function.Function; -import java.util.function.Supplier; import static org.elasticsearch.xpack.esql.type.EsqlDataTypes.isTemporalAmount; import static org.elasticsearch.xpack.ql.expression.TypeResolutions.ParamOrdinal.DEFAULT; @@ -40,21 +39,21 @@ public Neg(Source source, Expression field) { } @Override - public Supplier toEvaluator(Function> toEvaluator) { + public ExpressionEvaluator.Factory toEvaluator(Function toEvaluator) { DataType type = dataType(); if (type.isNumeric()) { var f = toEvaluator.apply(field()); - Supplier supplier = null; + ExpressionEvaluator.Factory supplier = null; if (type == DataTypes.INTEGER) { - supplier = () -> new NegIntsEvaluator(source(), f.get()); + supplier = dvrCtx -> new NegIntsEvaluator(source(), f.get(dvrCtx), dvrCtx); } // Unsigned longs are unsupported by choice; negating them would require implicitly converting to long. else if (type == DataTypes.LONG) { - supplier = () -> new NegLongsEvaluator(source(), f.get()); + supplier = dvrCtx -> new NegLongsEvaluator(source(), f.get(dvrCtx), dvrCtx); } else if (type == DataTypes.DOUBLE) { - supplier = () -> new NegDoublesEvaluator(f.get()); + supplier = dvrCtx -> new NegDoublesEvaluator(f.get(dvrCtx), dvrCtx); } if (supplier != null) { diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Sub.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Sub.java index a114795b07275..b00346b8cceb7 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Sub.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/Sub.java @@ -36,7 +36,7 @@ public Sub(Source source, Expression left, Expression right) { SubIntsEvaluator::new, SubLongsEvaluator::new, SubUnsignedLongsEvaluator::new, - (s, l, r) -> new SubDoublesEvaluator(l, r), + (s, l, r, dvrCtx) -> new SubDoublesEvaluator(l, r, dvrCtx), SubDatetimesEvaluator::new ); } diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java index 467e04deb579d..fefa23f7c1b92 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/planner/LocalExecutionPlanner.java @@ -91,7 +91,6 @@ import java.util.Optional; import java.util.Set; import java.util.function.Function; -import java.util.function.Supplier; import java.util.stream.Stream; import static java.util.stream.Collectors.joining; @@ -381,8 +380,7 @@ private PhysicalOperation planEval(EvalExec eval, LocalExecutionPlannerContext c PhysicalOperation source = plan(eval.child(), context); for (Alias field : eval.fields()) { - Supplier evaluatorSupplier; - evaluatorSupplier = EvalMapper.toEvaluator(field.child(), source.layout); + var evaluatorSupplier = EvalMapper.toEvaluator(field.child(), source.layout); Layout.Builder layout = source.layout.builder(); layout.append(field.toAttribute()); source = source.with(new EvalOperatorFactory(evaluatorSupplier), layout.build()); @@ -463,7 +461,7 @@ private PhysicalOperation planEnrich(EnrichExec enrich, LocalExecutionPlannerCon ); } - private Supplier toEvaluator(Expression exp, Layout layout) { + private ExpressionEvaluator.Factory toEvaluator(Expression exp, Layout layout) { return EvalMapper.toEvaluator(exp, layout); } @@ -680,7 +678,7 @@ public Driver apply(String sessionId) { List operators = new ArrayList<>(); SinkOperator sink = null; boolean success = false; - var driverContext = new DriverContext(); + var driverContext = new DriverContext(bigArrays); try { source = physicalOperation.source(driverContext); physicalOperation.operators(operators, driverContext); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java index 1db97943dfdad..80aeb25d49d4a 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/AbstractFunctionTestCase.java @@ -13,7 +13,9 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.BlockUtils; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; +import org.elasticsearch.compute.operator.EvalOperator.ExpressionEvaluator; import org.elasticsearch.core.PathUtils; import org.elasticsearch.logging.LogManager; import org.elasticsearch.test.ESTestCase; @@ -56,7 +58,6 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; -import java.util.function.Supplier; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; @@ -130,7 +131,7 @@ protected final Expression buildLiteralExpression(TestCaseSupplier.TestCase test return build(testCase.getSource(), testCase.getDataAsLiterals()); } - protected final Supplier evaluator(Expression e) { + protected final ExpressionEvaluator.Factory evaluator(Expression e) { e = new FoldNull().rule(e); if (e.foldable()) { e = new Literal(e.source(), e.fold(), e.dataType()); @@ -179,7 +180,7 @@ public final void testEvaluate() { expression = new FoldNull().rule(expression); assertThat(expression.dataType(), equalTo(testCase.expectedType)); // TODO should we convert unsigned_long into BigDecimal so it's easier to assert? - Object result = toJavaObject(evaluator(expression).get().eval(row(testCase.getDataValues())), 0); + Object result = toJavaObject(evaluator(expression).get(new DriverContext()).eval(row(testCase.getDataValues())), 0); assertThat(result, not(equalTo(Double.NaN))); assertThat(result, not(equalTo(Double.POSITIVE_INFINITY))); assertThat(result, not(equalTo(Double.NEGATIVE_INFINITY))); @@ -193,7 +194,7 @@ public final void testSimpleWithNulls() { // TODO replace this with nulls insert assumeTrue("nothing to do if a type error", testCase.getExpectedTypeError() == null); assumeTrue("All test data types must be representable in order to build fields", testCase.allTypesAreRepresentable()); List simpleData = testCase.getDataValues(); - EvalOperator.ExpressionEvaluator eval = evaluator(buildFieldExpression(testCase)).get(); + EvalOperator.ExpressionEvaluator eval = evaluator(buildFieldExpression(testCase)).get(new DriverContext()); Block[] orig = BlockUtils.fromListRow(simpleData); for (int i = 0; i < orig.length; i++) { List data = new ArrayList<>(); @@ -221,7 +222,7 @@ public final void testEvaluateInManyThreads() throws ExecutionException, Interru assumeTrue("All test data types must be representable in order to build fields", testCase.allTypesAreRepresentable()); int count = 10_000; int threads = 5; - Supplier evalSupplier = evaluator(buildFieldExpression(testCase)); + var evalSupplier = evaluator(buildFieldExpression(testCase)); ExecutorService exec = Executors.newFixedThreadPool(threads); try { List> futures = new ArrayList<>(); @@ -230,7 +231,7 @@ public final void testEvaluateInManyThreads() throws ExecutionException, Interru Page page = row(simpleData); futures.add(exec.submit(() -> { - EvalOperator.ExpressionEvaluator eval = evalSupplier.get(); + EvalOperator.ExpressionEvaluator eval = evalSupplier.get(new DriverContext()); for (int c = 0; c < count; c++) { assertThat(toJavaObject(eval.eval(page), 0), testCase.getMatcher()); } @@ -248,7 +249,7 @@ public final void testEvaluatorToString() { assumeTrue("nothing to do if a type error", testCase.getExpectedTypeError() == null); assumeTrue("All test data types must be representable in order to build fields", testCase.allTypesAreRepresentable()); var supplier = evaluator(buildFieldExpression(testCase)); - var ev = supplier.get(); + var ev = supplier.get(new DriverContext()); assertThat(ev.toString(), equalTo(testCase.evaluatorToString)); } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/CaseTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/CaseTests.java index db2e3fc482b8d..79138679e2414 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/CaseTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/conditional/CaseTests.java @@ -14,6 +14,7 @@ import org.elasticsearch.compute.data.Block; import org.elasticsearch.compute.data.IntBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.AbstractFunctionTestCase; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; @@ -88,7 +89,9 @@ protected Expression build(Source source, List args) { public void testEvalCase() { testCase( caseExpr -> toJavaObject( - caseExpr.toEvaluator(child -> evaluator(child)).get().eval(new Page(IntBlock.newConstantBlockWith(0, 1))), + caseExpr.toEvaluator(child -> evaluator(child)) + .get(new DriverContext()) + .eval(new Page(IntBlock.newConstantBlockWith(0, 1))), 0 ) ); @@ -148,13 +151,13 @@ public void testCaseIsLazy() { assertEquals(1, toJavaObject(caseExpr.toEvaluator(child -> { Object value = child.fold(); if (value != null && value.equals(2)) { - return () -> page -> { + return dvrCtx -> page -> { fail("Unexpected evaluation of 4th argument"); return null; }; } return evaluator(child); - }).get().eval(new Page(IntBlock.newConstantBlockWith(0, 1))), 0)); + }).get(new DriverContext()).eval(new Page(IntBlock.newConstantBlockWith(0, 1))), 0)); } private static Case caseExpr(Object... args) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundTests.java index f9e8886f960ad..cbfb0d6a579fe 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/math/RoundTests.java @@ -10,6 +10,7 @@ import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.ql.expression.Expression; @@ -84,12 +85,15 @@ public void testExamples() { } private Object process(Number val) { - return toJavaObject(evaluator(new Round(Source.EMPTY, field("val", typeOf(val)), null)).get().eval(row(List.of(val))), 0); + return toJavaObject( + evaluator(new Round(Source.EMPTY, field("val", typeOf(val)), null)).get(new DriverContext()).eval(row(List.of(val))), + 0 + ); } private Object process(Number val, int decimals) { return toJavaObject( - evaluator(new Round(Source.EMPTY, field("val", typeOf(val)), field("decimals", DataTypes.INTEGER))).get() + evaluator(new Round(Source.EMPTY, field("val", typeOf(val)), field("decimals", DataTypes.INTEGER))).get(new DriverContext()) .eval(row(List.of(val, decimals))), 0 ); @@ -115,7 +119,7 @@ protected DataType expectedType(List argTypes) { public void testNoDecimalsToString() { assertThat( - evaluator(new Round(Source.EMPTY, field("val", DataTypes.DOUBLE), null)).get().toString(), + evaluator(new Round(Source.EMPTY, field("val", DataTypes.DOUBLE), null)).get(new DriverContext()).toString(), equalTo("RoundDoubleNoDecimalsEvaluator[val=Attribute[channel=0]]") ); } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunctionTestCase.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunctionTestCase.java index ad74e1896a951..a300dbb383211 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunctionTestCase.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/AbstractMultivalueFunctionTestCase.java @@ -13,6 +13,7 @@ import org.elasticsearch.compute.data.ElementType; import org.elasticsearch.compute.data.Page; import org.elasticsearch.compute.data.Vector; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; @@ -444,7 +445,7 @@ private void testBlock(boolean insertNulls) { builder.copyFrom(oneRowBlock, 0, 1); } Block input = builder.build(); - Block result = evaluator(buildFieldExpression(testCase)).get().eval(new Page(input)); + Block result = evaluator(buildFieldExpression(testCase)).get(new DriverContext()).eval(new Page(input)); assertThat(result.getPositionCount(), equalTo(result.getPositionCount())); for (int p = 0; p < input.getPositionCount(); p++) { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcatTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcatTests.java index 4bd6403c98e2a..f6082af0e142e 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcatTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvConcatTests.java @@ -11,6 +11,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.ql.expression.Expression; @@ -71,18 +72,25 @@ public void testNull() { BytesRef bar = new BytesRef("bar"); BytesRef delim = new BytesRef(";"); Expression expression = buildFieldExpression(testCase); + DriverContext dvrCtx = new DriverContext(); - assertThat(toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(Arrays.asList(foo, bar), null))), 0), nullValue()); - assertThat(toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(foo, null))), 0), nullValue()); - assertThat(toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(null, null))), 0), nullValue()); + assertThat(toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(Arrays.asList(foo, bar), null))), 0), nullValue()); + assertThat(toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(foo, null))), 0), nullValue()); + assertThat(toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(null, null))), 0), nullValue()); assertThat( - toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(Arrays.asList(foo, bar), Arrays.asList(delim, bar)))), 0), + toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(Arrays.asList(foo, bar), Arrays.asList(delim, bar)))), 0), + nullValue() + ); + assertThat( + toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(foo, Arrays.asList(delim, bar)))), 0), + nullValue() + ); + assertThat( + toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(null, Arrays.asList(delim, bar)))), 0), nullValue() ); - assertThat(toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(foo, Arrays.asList(delim, bar)))), 0), nullValue()); - assertThat(toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(null, Arrays.asList(delim, bar)))), 0), nullValue()); - assertThat(toJavaObject(evaluator(expression).get().eval(row(Arrays.asList(null, delim))), 0), nullValue()); + assertThat(toJavaObject(evaluator(expression).get(dvrCtx).eval(row(Arrays.asList(null, delim))), 0), nullValue()); } } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/CoalesceTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/CoalesceTests.java index cba09907f35b9..b2345e85336d4 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/CoalesceTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/nulls/CoalesceTests.java @@ -11,6 +11,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.elasticsearch.compute.data.Block; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.evaluator.EvalMapper; import org.elasticsearch.xpack.esql.expression.function.AbstractFunctionTestCase; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; @@ -84,10 +85,10 @@ public void testCoalesceIsLazy() { Layout layout = builder.build(); assertThat(toJavaObject(exp.toEvaluator(child -> { if (child == evil) { - return () -> page -> { throw new AssertionError("shouldn't be called"); }; + return dvrCtx -> page -> { throw new AssertionError("shouldn't be called"); }; } return EvalMapper.toEvaluator(child, layout); - }).get().eval(row(testCase.getDataValues())), 0), testCase.getMatcher()); + }).get(new DriverContext()).eval(row(testCase.getDataValues())), 0), testCase.getMatcher()); } public void testCoalesceNullabilityIsUnknown() { diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java index 2b10c2c4f806e..7d5c18a5e3fd6 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/ConcatTests.java @@ -11,6 +11,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.ql.expression.Expression; @@ -98,7 +99,7 @@ public void testMany() { field("a", DataTypes.KEYWORD), IntStream.range(1, 5).mapToObj(i -> field(Integer.toString(i), DataTypes.KEYWORD)).toList() ) - ).get().eval(row(simpleData)), + ).get(new DriverContext()).eval(row(simpleData)), 0 ), equalTo(new BytesRef("cats and dogs")) @@ -120,7 +121,7 @@ public void testSomeConstant() { field("c", DataTypes.KEYWORD) ) ) - ).get().eval(row(simpleData)), + ).get(new DriverContext()).eval(row(simpleData)), 0 ), equalTo(new BytesRef("cats and dogs")) diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftTests.java index eb68509fdfafa..77807e6463324 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/LeftTests.java @@ -12,6 +12,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.ql.expression.Expression; @@ -198,7 +199,7 @@ public void testUnicode() { private String process(String str, int length) { Block result = evaluator( new Left(Source.EMPTY, field("str", DataTypes.KEYWORD), new Literal(Source.EMPTY, length, DataTypes.INTEGER)) - ).get().eval(row(List.of(new BytesRef(str)))); + ).get(new DriverContext()).eval(row(List.of(new BytesRef(str)))); if (null == result) { return null; } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightTests.java index 540051d9ac8b8..39222386a0cb0 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/RightTests.java @@ -12,6 +12,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.ql.expression.Expression; @@ -200,7 +201,7 @@ public void testUnicode() { private String process(String str, int length) { Block result = evaluator( new Right(Source.EMPTY, field("str", DataTypes.KEYWORD), new Literal(Source.EMPTY, length, DataTypes.INTEGER)) - ).get().eval(row(List.of(new BytesRef(str)))); + ).get(new DriverContext()).eval(row(List.of(new BytesRef(str)))); if (null == result) { return null; } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitTests.java index aba167759d32a..fc426be21e3f6 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SplitTests.java @@ -13,6 +13,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.BytesRefBlock; import org.elasticsearch.compute.data.Page; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; @@ -85,7 +86,7 @@ protected Expression build(Source source, List args) { public void testConstantDelimiter() { EvalOperator.ExpressionEvaluator eval = evaluator( new Split(Source.EMPTY, field("str", DataTypes.KEYWORD), new Literal(Source.EMPTY, new BytesRef(":"), DataTypes.KEYWORD)) - ).get(); + ).get(new DriverContext()); /* * 58 is ascii for : and appears in the toString below. We don't convert the delimiter to a * string because we aren't really sure it's printable. It could be a tab or a bell or some diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringTests.java index 5742b97f8f3ff..19113ed65ffbe 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/string/SubstringTests.java @@ -12,6 +12,7 @@ import org.apache.lucene.util.BytesRef; import org.elasticsearch.compute.data.Block; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.ql.expression.Expression; @@ -66,8 +67,9 @@ public Matcher resultsMatcher(List typedData public void testNoLengthToString() { assertThat( - evaluator(new Substring(Source.EMPTY, field("str", DataTypes.KEYWORD), field("start", DataTypes.INTEGER), null)).get() - .toString(), + evaluator(new Substring(Source.EMPTY, field("str", DataTypes.KEYWORD), field("start", DataTypes.INTEGER), null)).get( + new DriverContext() + ).toString(), equalTo("SubstringNoLengthEvaluator[str=Attribute[channel=0], start=Attribute[channel=1]]") ); } @@ -135,7 +137,7 @@ private String process(String str, int start, Integer length) { new Literal(Source.EMPTY, start, DataTypes.INTEGER), length == null ? null : new Literal(Source.EMPTY, length, DataTypes.INTEGER) ) - ).get().eval(row(List.of(new BytesRef(str)))); + ).get(new DriverContext()).eval(row(List.of(new BytesRef(str)))); return result == null ? null : ((BytesRef) toJavaObject(result, 0)).utf8ToString(); } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/AbstractBinaryOperatorTestCase.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/AbstractBinaryOperatorTestCase.java index 8a4f8963cba96..0ac08b61ec39e 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/AbstractBinaryOperatorTestCase.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/AbstractBinaryOperatorTestCase.java @@ -7,6 +7,7 @@ package org.elasticsearch.xpack.esql.expression.predicate.operator; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.analysis.Verifier; import org.elasticsearch.xpack.esql.expression.function.AbstractFunctionTestCase; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; @@ -92,7 +93,7 @@ public final void testApplyToAllTypes() { Source src = new Source(Location.EMPTY, lhsType.typeName() + " " + rhsType.typeName()); if (isRepresentable(lhsType) && isRepresentable(rhsType)) { op = build(src, field("lhs", lhsType), field("rhs", rhsType)); - result = toJavaObject(evaluator(op).get().eval(row(List.of(lhs.value(), rhs.value()))), 0); + result = toJavaObject(evaluator(op).get(new DriverContext()).eval(row(List.of(lhs.value(), rhs.value()))), 0); } else { op = build(src, lhs, rhs); result = op.fold(); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegTests.java index d5cd595ebc44a..f4de880bcd2b0 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/predicate/operator/arithmetic/NegTests.java @@ -10,6 +10,7 @@ import com.carrotsearch.randomizedtesting.annotations.Name; import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.xpack.esql.expression.function.TestCaseSupplier; import org.elasticsearch.xpack.esql.expression.function.scalar.AbstractScalarFunctionTestCase; import org.elasticsearch.xpack.esql.type.EsqlDataTypes; @@ -171,7 +172,7 @@ public void testEdgeCases() { private Object process(Object val) { if (testCase.allTypesAreRepresentable()) { Neg neg = new Neg(Source.EMPTY, field("val", typeOf(val))); - return toJavaObject(evaluator(neg).get().eval(row(List.of(val))), 0); + return toJavaObject(evaluator(neg).get(new DriverContext()).eval(row(List.of(val))), 0); } else { // just fold if type is not representable Neg neg = new Neg(Source.EMPTY, new Literal(Source.EMPTY, val, typeOf(val))); return neg.fold(); diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/EvalMapperTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/EvalMapperTests.java index f42c86d4b028a..34e6670862249 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/EvalMapperTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/planner/EvalMapperTests.java @@ -10,6 +10,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.apache.lucene.util.BytesRef; +import org.elasticsearch.compute.operator.DriverContext; import org.elasticsearch.compute.operator.EvalOperator; import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.esql.SerializationTestUtils; @@ -53,7 +54,6 @@ import java.util.Collections; import java.util.List; import java.util.Locale; -import java.util.function.Supplier; public class EvalMapperTests extends ESTestCase { private static final FieldAttribute DOUBLE1 = field("foo", DataTypes.DOUBLE); @@ -127,9 +127,9 @@ public void testEvaluatorSuppliers() { lb.append(LONG); Layout layout = lb.build(); - Supplier supplier = EvalMapper.toEvaluator(expression, layout); - EvalOperator.ExpressionEvaluator evaluator1 = supplier.get(); - EvalOperator.ExpressionEvaluator evaluator2 = supplier.get(); + var supplier = EvalMapper.toEvaluator(expression, layout); + EvalOperator.ExpressionEvaluator evaluator1 = supplier.get(new DriverContext()); + EvalOperator.ExpressionEvaluator evaluator2 = supplier.get(new DriverContext()); assertNotNull(evaluator1); assertNotNull(evaluator2); assertTrue(evaluator1 != evaluator2);