Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-3124

Infinite rule matching when AggregateRemoveRule is enabled for SUM0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Make the following changes (uncomment return clause) to AggregateRemoveRule, the test case JdbcTest.testHavingNot2 won't complete due to infinite rule matching.

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

      Attachments

        Issue Links

          Activity

            People

              x1q1j1 Forward Xu
              hyuan Haisheng Yuan
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: