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

If ReduceExpressionsRule generates the same plan, the original plan stops triggering other rules

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.7.0
    • Component/s: core
    • Labels:
      None

      Description

      Calcite allows users to implement a customized RelOptPlanner#Executor to determine how a RexNode is reduced to another.

      In some cases, the customized RelOptPlanner#Executor might decide not to do any reduction for a given RexNode (i.e., constExps2 and reducedValues are the same in [1]).

      However, for these cases, Calcite is not aware of the new plan is equivalent to the old one, but just go ahead to force the Importance of the old/new plan as ZERO [2]. After the Importance becomes ZERO, the original plan stops triggering other rules

      [1] github code: https://github.com/apache/calcite/blob/f55d10c147746d6299fb713adc184576380a1f49/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java#L508

      [2] github code:
      https://github.com/apache/calcite/blob/f55d10c147746d6299fb713adc184576380a1f49/core/src/main/java/org/apache/calcite/rel/rules/ReduceExpressionsRule.java#L184

        Attachments

          Activity

            People

            • Assignee:
              julianhyde Julian Hyde
              Reporter:
              seanhychu Sean Hsuan-Yi Chu
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: