morrySnow commented on code in PR #68468:
URL: https://github.com/apache/doris/pull/68468#discussion_r4117972946
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/executor/Rewriter.java:
##########
@@ -891,82 +895,75 @@ private static List<RewriteJob> getWholeTreeRewriteJobs(
if (includeNormalizePlanJobs) {
builder.addAll(NORMALIZE_PLAN_JOBS);
}
- builder.addAll(notTraverseChildrenOf(
- ImmutableSet.of(LogicalCTEAnchor.class),
- () -> {
- List<RewriteJob> rewriteJobs =
Lists.newArrayListWithExpectedSize(300);
- rewriteJobs.addAll(jobs(
- topic("cte inline and pull up all cte anchor",
- custom(RuleType.PULL_UP_CTE_ANCHOR,
PullUpCteAnchor::new),
- custom(RuleType.CTE_INLINE, CTEInline::new)
- ),
- topic("process limit session variables",
- custom(RuleType.ADD_DEFAULT_LIMIT,
AddDefaultLimit::new)
- ),
- topic("record query tmp plan for mv pre rewrite",
-
custom(RuleType.RECORD_PLAN_FOR_MV_PRE_REWRITE, RecordPlanForMvPreRewrite::new)
- ),
- topic("rewrite cte sub-tree before sub path push
down",
- custom(RuleType.REWRITE_CTE_CHILDREN,
- () -> new
RewriteCteChildren(beforePushDownJobs, runCboRules)
- )
- )));
- rewriteJobs.addAll(jobs(topic("convert outer join to anti",
- custom(RuleType.CONVERT_OUTER_JOIN_TO_ANTI,
ConvertOuterJoinToAntiJoin::new))));
- rewriteJobs.addAll(jobs(topic("eliminate Aggregate
according to fd items",
- cascadesContext ->
cascadesContext.rewritePlanContainsTypes(LogicalAggregate.class)
- ||
cascadesContext.rewritePlanContainsTypes(LogicalJoin.class)
- ||
cascadesContext.rewritePlanContainsTypes(LogicalUnion.class),
- custom(RuleType.ELIMINATE_GROUP_BY_KEY,
EliminateGroupByKey::new))));
- rewriteJobs.addAll(jobs(topic("eliminate group by key by
uniform",
- custom(RuleType.ELIMINATE_GROUP_BY_KEY_BY_UNIFORM,
EliminateGroupByKeyByUniform::new))));
- if (needOrExpansion) {
- rewriteJobs.addAll(jobs(topic("or expansion",
- custom(RuleType.OR_EXPANSION, () ->
OrExpansion.INSTANCE))));
- }
- rewriteJobs.add(topic("repeat rewrite",
- custom(RuleType.DECOMPOSE_REPEAT, () ->
DecomposeRepeatWithPreAggregation.INSTANCE)));
-
- rewriteJobs.addAll(jobs(topic("split multi distinct",
- custom(RuleType.DISTINCT_AGG_STRATEGY_SELECTOR,
- () ->
DistinctAggStrategySelector.INSTANCE))));
-
- // Rewrite search function before VariantSubPathPruning
- // so that ElementAt expressions from search can be
processed
- rewriteJobs.addAll(jobs(
- bottomUp(new RewriteSearchToSlots())
- ));
-
- if (needSubPathPushDown) {
- rewriteJobs.addAll(jobs(
- topic("variant element_at push down",
-
custom(RuleType.VARIANT_SUB_PATH_PRUNING, VariantSubPathPruning::new)
+ List<RewriteJob> rewriteJobs = Lists.newArrayListWithExpectedSize(300);
Review Comment:
这个改法有点儿奇怪啊,为什么不直接在builder里面add?
--
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]