Sean Hsuan-Yi Chu created CALCITE-1100:
------------------------------------------
Summary: If ReduceExpressionsRule generates the same plan, the
original plan stops triggering other rules
Key: CALCITE-1100
URL: https://issues.apache.org/jira/browse/CALCITE-1100
Project: Calcite
Issue Type: Bug
Components: core
Reporter: Sean Hsuan-Yi Chu
Assignee: Sean Hsuan-Yi Chu
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 {color:red}new plan is
equivalent to the old one{color}, but just go ahead to force the
{color:red}Importance{color} of the old/new plan as ZERO [2]. After the
{color:red}Importance{color} 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
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)