[ https://issues.apache.org/jira/browse/CALCITE-3124?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17940050#comment-17940050 ]
Alessandro Solimando edited comment on CALCITE-3124 at 4/2/25 9:22 AM: ----------------------------------------------------------------------- This seems to be fixed in current "main", I can't reproduce it. Bisecting I got to [5b996bd59|https://github.com/apache/calcite/commit/5b996bd595cbe775f7534f14546db66241f32eda] but I suspect this fixes the symptoms in the JDBC test rather than the issue itself. was (Author: asolimando): This seems to be fixed in current "main", I can't reproduce it. Bisecting I got to [5b996bd59|https://github.com/apache/calcite/commit/5b996bd595cbe775f7534f14546db66241f32eda] but I am suspecting it's because of the JDBC test rather than a fix for the issue itself. > Infinite rule matching when AggregateRemoveRule is enabled for SUM0 > ------------------------------------------------------------------- > > Key: CALCITE-3124 > URL: https://issues.apache.org/jira/browse/CALCITE-3124 > Project: Calcite > Issue Type: Bug > Reporter: Haisheng Yuan > Assignee: Forward Xu > Priority: Major > > Make the following changes (uncomment return clause) to AggregateRemoveRule, > the test case {{JdbcTest.testHavingNot2}} won't complete due to infinite rule > matching. > {noformat} > --- a/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java > +++ b/core/src/main/java/org/apache/calcite/rel/rules/AggregateRemoveRule.java > @@ -102,7 +102,7 @@ public void onMatch(RelOptRuleCall call) { > if (aggregation.getKind() == SqlKind.SUM0) { > // Bail out for SUM0 to avoid potential infinite rule matching, > // because it may be generated by transforming SUM aggregate > // function to SUM0 and COUNT. > - return; > +// return; > } > final SqlSplittableAggFunction splitter = > Objects.requireNonNull( > {noformat} -- This message was sent by Atlassian Jira (v8.20.10#820010)