xiedeyantu commented on code in PR #4471:
URL: https://github.com/apache/calcite/pull/4471#discussion_r2215488991
##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -11087,4 +11087,14 @@ private void
checkLoptOptimizeJoinRule(LoptOptimizeJoinRule rule) {
.withRule(CoreRules.FULL_TO_LEFT_AND_RIGHT_JOIN)
.checkUnchanged();
}
+
+ @Test void testAggregateFilterToCase() {
Review Comment:
Please add Jira description here.
##########
core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java:
##########
@@ -11087,4 +11087,14 @@ private void
checkLoptOptimizeJoinRule(LoptOptimizeJoinRule rule) {
.withRule(CoreRules.FULL_TO_LEFT_AND_RIGHT_JOIN)
.checkUnchanged();
}
+
+ @Test void testAggregateFilterToCase() {
+ final String sql = "select\n"
+ + " sum(sal) filter(where deptno = 10) as sum_match,\n"
+ + " sum(distinct empno) filter(where deptno = 20) as
sum_distinct_not_match,\n"
Review Comment:
Could you please add a SUM0 case? Maybe like the following that described in
AggregateCaseToFilterRule.
```
SUM0(cnt) FILTER (x = 'foo')
=>
SUM0(CASE WHEN x = 'foo' THEN cnt ELSE 0 END)
```
--
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]