Skip to content

Commit 086e298

Browse files
committed
fix other tests
1 parent cf52d07 commit 086e298

File tree

2 files changed

+14
-4
lines changed
  • x-pack/plugin/esql/qa

2 files changed

+14
-4
lines changed

x-pack/plugin/esql/qa/server/single-node/src/javaRestTest/java/org/elasticsearch/xpack/esql/qa/single_node/RestEsqlIT.java

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.xcontent.XContentBuilder;
2828
import org.elasticsearch.xcontent.XContentType;
2929
import org.elasticsearch.xcontent.json.JsonXContent;
30+
import org.elasticsearch.xpack.esql.core.plugin.EsqlCorePlugin;
3031
import org.elasticsearch.xpack.esql.core.type.DataType;
3132
import org.elasticsearch.xpack.esql.qa.rest.RestEsqlTestCase;
3233
import org.elasticsearch.xpack.esql.tools.ProfileParser;
@@ -42,6 +43,7 @@
4243
import java.util.ArrayList;
4344
import java.util.Arrays;
4445
import java.util.Comparator;
46+
import java.util.HashMap;
4547
import java.util.HashSet;
4648
import java.util.List;
4749
import java.util.Locale;
@@ -672,19 +674,25 @@ public void testSuggestedCast() throws IOException {
672674
"type": "Point",
673675
"coordinates": [-77.03653, 38.897676]
674676
}
675-
"""),
676-
Map.entry(DataType.AGGREGATE_METRIC_DOUBLE, """
677+
""")
678+
);
679+
if (EsqlCorePlugin.AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG.isEnabled()) {
680+
typesAndValues = new HashMap<>(typesAndValues);
681+
typesAndValues.put(DataType.AGGREGATE_METRIC_DOUBLE, """
677682
{
678683
"max": 14983.1
679684
}
680-
""")
681-
);
685+
""");
686+
}
682687
Set<DataType> shouldBeSupported = Stream.of(DataType.values()).filter(DataType::isRepresentable).collect(Collectors.toSet());
683688
shouldBeSupported.remove(DataType.CARTESIAN_POINT);
684689
shouldBeSupported.remove(DataType.CARTESIAN_SHAPE);
685690
shouldBeSupported.remove(DataType.NULL);
686691
shouldBeSupported.remove(DataType.DOC_DATA_TYPE);
687692
shouldBeSupported.remove(DataType.TSID_DATA_TYPE);
693+
if (EsqlCorePlugin.AGGREGATE_METRIC_DOUBLE_FEATURE_FLAG.isEnabled() == false) {
694+
shouldBeSupported.remove(DataType.AGGREGATE_METRIC_DOUBLE);
695+
}
688696
for (DataType type : shouldBeSupported) {
689697
assertTrue(typesAndValues.containsKey(type));
690698
}

x-pack/plugin/esql/qa/testFixtures/src/main/resources/convert.csv-spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,7 @@ x:integer | agg_metric:aggregate_metric_double
484484

485485
convertToAggregateMetricDoubleCastingOperatorFromDouble
486486
required_capability: suggested_cast
487+
required_capability: aggregate_metric_double_convert_to
487488
ROW x = 29384.1256
488489
| EVAL agg_metric = x::aggregate_metric_double
489490
;
@@ -494,6 +495,7 @@ x:double | agg_metric:aggregate_metric_double
494495

495496
convertToAggregateMetricDoubleCastingOperatorFromInt
496497
required_capability: suggested_cast
498+
required_capability: aggregate_metric_double_convert_to
497499
ROW x = 55555
498500
| EVAL agg_metric = x::aggregate_metric_double
499501
;

0 commit comments

Comments
 (0)