diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AbsentTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AbsentTests.java index 0739f2226d710..9737f8ce1cf72 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AbsentTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/AbsentTests.java @@ -11,6 +11,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.elasticsearch.xpack.esql.core.expression.Expression; +import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin; import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.expression.function.AbstractAggregationTestCase; @@ -61,7 +62,7 @@ public static Iterable parameters() { ).flatMap(List::stream).map(AbsentTests::makeSupplier).collect(Collectors.toCollection(() -> suppliers)); // No rows - for (var dataType : List.of( + List types = List.of( DataType.AGGREGATE_METRIC_DOUBLE, DataType.BOOLEAN, DataType.CARTESIAN_POINT, @@ -78,9 +79,13 @@ public static Iterable parameters() { DataType.LONG, DataType.TEXT, DataType.UNSIGNED_LONG, - DataType.VERSION, - DataType.EXPONENTIAL_HISTOGRAM - )) { + DataType.VERSION + ); + if (EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()) { + types = new ArrayList<>(types); + types.add(DataType.EXPONENTIAL_HISTOGRAM); + } + for (var dataType : types) { suppliers.add( new TestCaseSupplier( "No rows (" + dataType + ")", diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/PresentTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/PresentTests.java index 3f765edc8d65b..4980af59623df 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/PresentTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/aggregate/PresentTests.java @@ -11,6 +11,7 @@ import com.carrotsearch.randomizedtesting.annotations.ParametersFactory; import org.elasticsearch.xpack.esql.core.expression.Expression; +import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin; import org.elasticsearch.xpack.esql.core.tree.Source; import org.elasticsearch.xpack.esql.core.type.DataType; import org.elasticsearch.xpack.esql.expression.function.AbstractAggregationTestCase; @@ -61,7 +62,7 @@ public static Iterable parameters() { ).flatMap(List::stream).map(PresentTests::makeSupplier).collect(Collectors.toCollection(() -> suppliers)); // No rows - for (var dataType : List.of( + List types = List.of( DataType.AGGREGATE_METRIC_DOUBLE, DataType.BOOLEAN, DataType.CARTESIAN_POINT, @@ -78,9 +79,13 @@ public static Iterable parameters() { DataType.LONG, DataType.TEXT, DataType.UNSIGNED_LONG, - DataType.VERSION, - DataType.EXPONENTIAL_HISTOGRAM - )) { + DataType.VERSION + ); + if (EsqlCorePlugin.EXPONENTIAL_HISTOGRAM_FEATURE_FLAG.isEnabled()) { + types = new ArrayList<>(types); + types.add(DataType.EXPONENTIAL_HISTOGRAM); + } + for (var dataType : types) { suppliers.add( new TestCaseSupplier( "No rows (" + dataType + ")",