Skip to content

Commit 3cab2c1

Browse files
committed
Update tests
1 parent 9a12405 commit 3cab2c1

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/AnalyzerTests.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,19 +2008,15 @@ public void testUnsupportedTypesInStats() {
20082008
row x = to_unsigned_long(\"10\")
20092009
| stats avg(x), count_distinct(x), max(x), median(x), median_absolute_deviation(x), min(x), percentile(x, 10), sum(x)
20102010
""", """
2011-
Found 8 problems
2011+
Found 6 problems
20122012
line 2:12: argument of [avg(x)] must be [aggregate_metric_double or numeric except unsigned_long or counter types],\
20132013
found value [x] type [unsigned_long]
20142014
line 2:20: argument of [count_distinct(x)] must be [any exact type except unsigned_long, _source, or counter types],\
20152015
found value [x] type [unsigned_long]
2016-
line 2:39: argument of [max(x)] must be [representable except unsigned_long and spatial types],\
2017-
found value [x] type [unsigned_long]
20182016
line 2:47: argument of [median(x)] must be [numeric except unsigned_long or counter types],\
20192017
found value [x] type [unsigned_long]
20202018
line 2:58: argument of [median_absolute_deviation(x)] must be [numeric except unsigned_long or counter types],\
20212019
found value [x] type [unsigned_long]
2022-
line 2:88: argument of [min(x)] must be [representable except unsigned_long and spatial types],\
2023-
found value [x] type [unsigned_long]
20242020
line 2:96: first argument of [percentile(x, 10)] must be [numeric except unsigned_long],\
20252021
found value [x] type [unsigned_long]
20262022
line 2:115: argument of [sum(x)] must be [aggregate_metric_double or numeric except unsigned_long or counter types],\

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ public void testAggregateOnCounter() {
10861086
error("FROM tests | STATS min(network.bytes_in)", tsdb),
10871087
equalTo(
10881088
"1:20: argument of [min(network.bytes_in)] must be"
1089-
+ " [representable except unsigned_long and spatial types],"
1089+
+ " [boolean, date, ip, string, version, aggregate_metric_double or numeric except counter types],"
10901090
+ " found value [network.bytes_in] type [counter_long]"
10911091
)
10921092
);
@@ -1095,7 +1095,7 @@ public void testAggregateOnCounter() {
10951095
error("FROM tests | STATS max(network.bytes_in)", tsdb),
10961096
equalTo(
10971097
"1:20: argument of [max(network.bytes_in)] must be"
1098-
+ " [representable except unsigned_long and spatial types],"
1098+
+ " [boolean, date, ip, string, version, aggregate_metric_double or numeric except counter types],"
10991099
+ " found value [network.bytes_in] type [counter_long]"
11001100
)
11011101
);

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ protected Expression build(Source source, List<Expression> args) {
3232

3333
@Override
3434
protected Matcher<String> expectedTypeErrorMatcher(List<Set<DataType>> validPerPosition, List<DataType> signature) {
35-
return equalTo(typeErrorMessage(false, validPerPosition, signature, (v, p) -> "representableNonSpatial"));
35+
return equalTo(
36+
typeErrorMessage(
37+
false,
38+
validPerPosition,
39+
signature,
40+
(v, p) -> "boolean, date, ip, string, version or numeric except counter types"
41+
)
42+
);
3643
}
3744
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ protected Expression build(Source source, List<Expression> args) {
3232

3333
@Override
3434
protected Matcher<String> expectedTypeErrorMatcher(List<Set<DataType>> validPerPosition, List<DataType> signature) {
35-
return equalTo(typeErrorMessage(false, validPerPosition, signature, (v, p) -> "representableNonSpatial"));
35+
return equalTo(
36+
typeErrorMessage(
37+
false,
38+
validPerPosition,
39+
signature,
40+
(v, p) -> "boolean, date, ip, string, version or numeric except counter types"
41+
)
42+
);
3643
}
3744
}

0 commit comments

Comments
 (0)