File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -2140,6 +2140,33 @@ public void testFilterByAggregate() {
21402140 );
21412141 }
21422142
2143+ public void testDissectByAggregate () {
2144+ assertEquals (
2145+ "1:21: aggregate function [min(first_name)] not allowed outside STATS command" ,
2146+ error ("from test | dissect min(first_name) \" %{foo}\" " )
2147+ );
2148+ assertEquals (
2149+ "1:21: aggregate function [avg(salary)] not allowed outside STATS command" ,
2150+ error ("from test | dissect avg(salary) \" %{foo}\" " )
2151+ );
2152+ }
2153+
2154+ public void testGrokByAggregate () {
2155+ assertEquals (
2156+ "1:18: aggregate function [max(last_name)] not allowed outside STATS command" ,
2157+ error ("from test | grok max(last_name) \" %{WORD:foo}\" " )
2158+ );
2159+ assertEquals (
2160+ "1:18: aggregate function [sum(salary)] not allowed outside STATS command" ,
2161+ error ("from test | grok sum(salary) \" %{WORD:foo}\" " )
2162+ );
2163+ }
2164+
2165+ public void testAggregateInRow () {
2166+ assertEquals ("1:13: aggregate function [count(*)] not allowed outside STATS command" , error ("ROW a = 1 + count(*)" ));
2167+ assertEquals ("1:9: aggregate function [avg(2)] not allowed outside STATS command" , error ("ROW a = avg(2)" ));
2168+ }
2169+
21432170 public void testLookupJoinDataTypeMismatch () {
21442171 assumeTrue ("requires LOOKUP JOIN capability" , EsqlCapabilities .Cap .JOIN_LOOKUP_V12 .isEnabled ());
21452172
You can’t perform that action at this time.
0 commit comments