github-actions[bot] commented on code in PR #64618:
URL: https://github.com/apache/doris/pull/64618#discussion_r3457596403
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java:
##########
@@ -606,7 +606,7 @@ public class Rewriter extends AbstractBatchJobExecutor {
topic("",
cascadesContext ->
cascadesContext.rewritePlanContainsTypes(SetOperation.class),
topDown(new MergeOneRowRelationIntoUnion()),
- costBased(topDown(new
InferSetOperatorDistinct())),
+ topDown(new InferSetOperatorDistinct()),
Review Comment:
`costBased(...)` was also the mechanism that kept this rule out of no-cost
rewrite passes. After this change, `getWholeTreeRewriterWithoutCostBasedJobs()`
still builds the full whole-tree job list with `runCboRules=false`, but
`shouldRun()` only skips jobs that are instances of `CostBasedRewriteJob`; a
plain `topDown(new InferSetOperatorDistinct())` will now run there. Those
no-cost paths are used while costing CTE candidates in
`CostBasedRewriteJob#getCost()` and during pre-MV rewrite. That means a rule
that is now explicitly stats/NDV based can change the plan in places that
intentionally asked for no cost-based jobs, which can affect MV normalization
or the plan being costed. Please keep this rule behind a cost-based wrapper, or
add an explicit guard/test for the no-cost rewriter path if this behavior is
intentional.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]