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

Infinite rule matching when AggregateRemoveRule is enabled for SUM0

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      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

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

                Dates

                • Created:
                  Updated: