You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SQL: Fix issue with complex HAVING and GROUP BY ordinal (#36594)
When trying to analyse a HAVING condition, we crate a temp Aggregate
Plan which wasn't created correctly (missing the expressions from the
SELECT clause) and as a result the ordinal (1, 2, etc) in the GROUP BY
couldn't be resolved correctly.
Also after successfully analysing the HAVING condition, still the
original plan was returned.
Fixes: #36059
Copy file name to clipboardExpand all lines: x-pack/plugin/sql/src/test/java/org/elasticsearch/xpack/sql/analysis/analyzer/VerifierErrorMessagesTests.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -183,7 +183,7 @@ public void testGroupByOrderByScalarOverNonGrouped_WithHaving() {
183
183
}
184
184
185
185
publicvoidtestGroupByHavingNonGrouped() {
186
-
assertEquals("1:48: Cannot filter by non-grouped column [int], expected [text]",
186
+
assertEquals("1:48: Cannot filter HAVING on non-aggregate [int]; consider using WHERE instead",
187
187
error("SELECT AVG(int) FROM test GROUP BY text HAVING int > 10"));
0 commit comments