xuzifu666 commented on code in PR #4961:
URL: https://github.com/apache/calcite/pull/4961#discussion_r3291765330
##########
core/src/test/resources/org/apache/calcite/test/AggregateReduceFunctionsOnGroupKeysRuleTest.xml:
##########
@@ -51,6 +143,48 @@ LogicalProject(SAL=[$0], COMM_MAX=[$2])
LogicalAggregate(group=[{0, 1}], COMM_MAX=[MAX($2)])
LogicalProject(SAL=[$5], DEPTNO=[$7], COMM=[$6])
LogicalTableScan(table=[[CATALOG, SALES, EMP]])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testAggregateFunctionOfGroupByKeysNullExpression">
+ <Resource name="sql">
+ <![CDATA[select comm, max(comm + 1) as max_plus
+from empnullables group by comm]]>
+ </Resource>
+ <Resource name="planBefore">
+ <![CDATA[
+LogicalAggregate(group=[{0}], MAX_PLUS=[MAX($1)])
+ LogicalProject(COMM=[$6], $f1=[+($6, 1)])
+ LogicalTableScan(table=[[CATALOG, SALES, EMPNULLABLES]])
+]]>
+ </Resource>
+ <Resource name="planAfter">
+ <![CDATA[
+LogicalProject(COMM=[$0], $f1=[+($0, 1)])
+ LogicalAggregate(group=[{0}])
+ LogicalProject(COMM=[$6], $f1=[+($6, 1)])
+ LogicalTableScan(table=[[CATALOG, SALES, EMPNULLABLES]])
+]]>
+ </Resource>
+ </TestCase>
+ <TestCase name="testAggregateFunctionOfGroupByKeysNullGroupKey">
+ <Resource name="sql">
+ <![CDATA[select comm, max(comm) as comm_max
+from empnullables group by comm]]>
+ </Resource>
+ <Resource name="planBefore">
+ <![CDATA[
+LogicalAggregate(group=[{0}], COMM_MAX=[MAX($0)])
+ LogicalProject(COMM=[$6])
+ LogicalTableScan(table=[[CATALOG, SALES, EMPNULLABLES]])
+]]>
+ </Resource>
+ <Resource name="planAfter">
+ <![CDATA[
+LogicalProject(COMM=[$0], COMM0=[$0])
Review Comment:
You're right, I've fixed this issue. PTAL~
--
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]