Add test with alias reuse and grouping. (cherry picked from commit 37ee819eb98fd10c1b16a61e4e1d446d0ee859de)
This commit is contained in:
parent
5359417ec3
commit
79ef263fc2
|
@ -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"));
|
||||
|
|
Loading…
Reference in New Issue