Skip to content

Commit 78da031

Browse files
committed
And some more tests
1 parent 4c43afa commit 78da031

File tree

6 files changed

+10
-7
lines changed

6 files changed

+10
-7
lines changed

x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/data/BlockMultiValuedTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ public static List<Object[]> params() {
4949
|| e == ElementType.NULL
5050
|| e == ElementType.DOC
5151
|| e == ElementType.COMPOSITE
52-
|| e == ElementType.AGGREGATE_METRIC_DOUBLE) {
52+
|| e == ElementType.AGGREGATE_METRIC_DOUBLE
53+
|| e == ElementType.DATE_RANGE) {
5354
continue;
5455
}
5556
for (boolean nullAllowed : new boolean[] { false, true }) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2030,7 +2030,7 @@ emp_no:integer | birth_date:date | hire_date:date
20302030
;
20312031

20322032
dateRange
2033-
2033+
required_capability: date_range_field_type
20342034
from date_ranges;
20352035

20362036
date_range:date_range | decade:integer | description:keyword

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,9 @@ public enum Cap {
14991499
/**
15001500
* Support for dots in FUSE attributes
15011501
*/
1502-
DOTS_IN_FUSE;
1502+
DOTS_IN_FUSE,
1503+
1504+
DATE_RANGE_FIELD_TYPE;
15031505

15041506
private final boolean enabled;
15051507

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvAppendErrorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected Expression build(Source source, List<Expression> args) {
3333

3434
@Override
3535
protected Matcher<String> expectedTypeErrorMatcher(List<Set<DataType>> validPerPosition, List<DataType> signature) {
36-
var unsupportedTypes = List.of(DataType.AGGREGATE_METRIC_DOUBLE, DataType.DENSE_VECTOR);
36+
var unsupportedTypes = List.of(DataType.AGGREGATE_METRIC_DOUBLE, DataType.DENSE_VECTOR, DataType.DATE_RANGE);
3737
if (unsupportedTypes.contains(signature.getFirst())
3838
|| signature.getFirst() == DataType.NULL && unsupportedTypes.contains(signature.get(1))) {
3939
return containsString(

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvCountErrorTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ protected Matcher<String> expectedTypeErrorMatcher(List<Set<DataType>> validPerP
3737
false,
3838
validPerPosition,
3939
signature,
40-
(v, p) -> "any type except counter types, dense_vector, aggregate_metric_double, or date_range"
40+
(v, p) -> "any type except counter types, dense_vector, aggregate_metric_double or date_range"
4141
)
4242
);
4343
}
4444

4545
@Override
4646
protected void assertNumberOfCheckedSignatures(int checked) {
47-
assertThat("all signatures except dense_vector, aggregate_metric_double or date_range should be supported", checked, equalTo(2));
47+
assertThat("all signatures except dense_vector, aggregate_metric_double or date_range should be supported", checked, equalTo(3));
4848
}
4949

5050
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/expression/function/scalar/multivalue/MvDedupeErrorTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected void assertNumberOfCheckedSignatures(int checked) {
4848
* In general MvDedupe should support all signatures. While building a
4949
* new type you may we to temporarily relax this.
5050
*/
51-
assertThat("all signatures except dense_vector and aggregate_metric_double should be supported", checked, equalTo(2));
51+
assertThat("all signatures except dense_vector, aggregate_metric_double or date_range should be supported", checked, equalTo(3));
5252
}
5353

5454
}

0 commit comments

Comments
 (0)