diff --git a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/analysis/analyzer/VerifierErrorMessagesTests.java b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/analysis/analyzer/VerifierErrorMessagesTests.java index 1b0a8767593..a6bdb4d36e7 100644 --- a/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/analysis/analyzer/VerifierErrorMessagesTests.java +++ b/x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/analysis/analyzer/VerifierErrorMessagesTests.java @@ -633,6 +633,11 @@ public class VerifierErrorMessagesTests extends ESTestCase { error("SELECT int FROM test GROUP BY int ORDER BY SCORE()")); } + public void testGroupByWithRepeatedAliases() { + accept("SELECT int as x, keyword as x, max(date) as a FROM test GROUP BY 1, 2"); + accept("SELECT int as x, keyword as x, max(date) as a FROM test GROUP BY int, keyword"); + } + public void testHavingOnColumn() { assertEquals("1:42: Cannot use HAVING filter on non-aggregate [int]; use WHERE instead", error("SELECT int FROM test GROUP BY int HAVING int > 2"));