NobiGo commented on code in PR #3055:
URL: https://github.com/apache/calcite/pull/3055#discussion_r1093904573


##########
core/src/test/java/org/apache/calcite/test/SqlValidatorTest.java:
##########
@@ -5673,6 +5673,21 @@ public boolean isBangEqualAllowed() {
         .withConformance(strict).ok();
   }
 
+  /** Test case for
+   * <a 
href="https://issues.apache.org/jira/browse/CALCITE-5507";>[CALCITE-5507]
+   * HAVING alias failed when aggregate function in condition</a>. */
+  @Test void testAggregateFunAndAliasInHaving() {
+    final SqlConformanceEnum lenient = SqlConformanceEnum.LENIENT;
+    final SqlConformanceEnum strict = SqlConformanceEnum.STRICT_2003;
+
+    sql("select count(empno) as e from emp having ^e^ > 10 and count(empno) > 
10 ")

Review Comment:
   According to the Jira comment, I think we should not add the ^ in the SQL. 
According to the test, developers can know the wrong place.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to