Skip to content

Commit 9651f4c

Browse files
committed
Update test
1 parent ccc23fc commit 9651f4c

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,17 @@ public void testNotFoundFieldInNestedFunction() {
10141014
line 1:23: Unknown column [avg]""", error("from test | stats c = avg by missing + 1, not_found"));
10151015
}
10161016

1017+
public void testMultipleAggsOutsideStats() {
1018+
assertEquals(
1019+
"""
1020+
1:71: aggregate function [avg(salary)] not allowed outside STATS command
1021+
line 1:96: aggregate function [median(emp_no)] not allowed outside STATS command
1022+
line 1:22: aggregate function [sum(salary)] not allowed outside STATS command
1023+
line 1:39: aggregate function [avg(languages)] not allowed outside STATS command""",
1024+
error("from test | eval s = sum(salary), l = avg(languages) | where salary > avg(salary) and emp_no > median(emp_no)")
1025+
);
1026+
}
1027+
10171028
public void testSpatialSort() {
10181029
String prefix = "ROW wkt = [\"POINT(42.9711 -14.7553)\", \"POINT(75.8093 22.7277)\"] | MV_EXPAND wkt ";
10191030
assertEquals("1:130: cannot sort on geo_point", error(prefix + "| EVAL shape = TO_GEOPOINT(wkt) | limit 5 | sort shape"));

0 commit comments

Comments
 (0)