[fix](Nereids)get NPE and group not be optimized when add REWRITE rule to Cascades Optimzer (#12346)
Fix some bugs when add REWRITE rule to Cascades Optimizer - all rule should set as not rewrite rule when use them in Cascades Optimizer - IMPLEMENT rule promise should large than others since we should do exploration first.
This commit is contained in:
@ -66,7 +66,7 @@ public class ApplyRuleJob extends Job {
|
||||
for (Plan newPlan : newPlans) {
|
||||
CopyInResult result = context.getCascadesContext()
|
||||
.getMemo()
|
||||
.copyIn(newPlan, groupExpression.getOwnerGroup(), rule.isRewrite());
|
||||
.copyIn(newPlan, groupExpression.getOwnerGroup(), false);
|
||||
if (!result.generateNewExpression) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -19,12 +19,13 @@ package org.apache.doris.nereids.rules;
|
||||
|
||||
/**
|
||||
* Promise of rule, The value with a large promise has a higher priority.
|
||||
* NOTICE: we must ensure that the promise of the IMPLEMENT is greater than the promise of the others.
|
||||
*/
|
||||
public enum RulePromise {
|
||||
ANALYSIS,
|
||||
REWRITE,
|
||||
EXPLORE,
|
||||
IMPLEMENT,
|
||||
REWRITE,
|
||||
ANALYSIS,
|
||||
|
||||
// just for check plan in UT
|
||||
PLAN_CHECK
|
||||
|
||||
Reference in New Issue
Block a user