hannerwang commented on a change in pull request #2408:
URL: https://github.com/apache/calcite/pull/2408#discussion_r623676488



##########
File path: 
core/src/test/resources/org/apache/calcite/test/SqlToRelConverterTest.xml
##########
@@ -142,14 +145,15 @@ LogicalAggregate(group=[{}], EXPR$0=[COUNT()])
     <TestCase name="testAliasInHaving">
         <Resource name="plan">
             <![CDATA[
-LogicalFilter(condition=[>($0, 1)])
-  LogicalAggregate(group=[{}], E=[COUNT()])
-    LogicalProject(EMPNO=[$0])
-      LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+LogicalProject(ENAME=[$0], E=[$1], D=[$1])
+  LogicalFilter(condition=[>($1, 2)])
+    LogicalAggregate(group=[{0}], E=[COUNT()])
+      LogicalProject(ENAME=[$1], EMPNO=[$0], DEPTNO=[$7])
+        LogicalTableScan(table=[[CATALOG, SALES, EMP]])
 ]]>

Review comment:
       it's the result of reducing COUNT aggregation whose args type has NOT 
NULL constraint to be count(&ast;). In this case, EMPNO and DEPTNO are integer 
and not null, so count(empno) and count(deptno) can be reduced as just one 
count(&ast;), furthermore the count(&ast;) > 1 and count(&ast;) > 2 can be 
reduced to count(&ast;) > 2.




-- 
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.

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


Reply via email to