jackwener commented on code in PR #11812: URL: https://github.com/apache/doris/pull/11812#discussion_r953761933
########## fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/batch/RewriteJob.java: ########## @@ -40,13 +41,14 @@ public class RewriteJob extends BatchRulesJob { public RewriteJob(CascadesContext cascadesContext) { super(cascadesContext); ImmutableList<Job> jobs = new ImmutableList.Builder<Job>() - .add(bottomUpBatch(ImmutableList.of(new MergeConsecutiveProjects()))) - .add(topDownBatch(ImmutableList.of(new ExpressionNormalization()))) - .add(topDownBatch(ImmutableList.of(new ReorderJoin()))) - .add(topDownBatch(ImmutableList.of(new PushPredicateThroughJoin()))) + // add rules in reverse order due to jobPool is stack. .add(topDownBatch(ImmutableList.of(new AggregateDisassemble()))) - .build().reverse(); // reverse due to jobPool is stack. - + .add(topDownBatch(ImmutableList.of(new PushPredicateThroughJoin()))) + .add(topDownBatch(ImmutableList.of(new FindHashConditionForJoin()))) + .add(topDownBatch(ImmutableList.of(new ReorderJoin()))) + .add(topDownBatch(ImmutableList.of(new ExpressionNormalization()))) + .add(bottomUpBatch(ImmutableList.of(new MergeConsecutiveProjects()))) + .build().reverse(); Review Comment: keep order(), remove the reverse() ########## fe/fe-core/src/main/java/org/apache/doris/nereids/jobs/batch/RewriteJob.java: ########## @@ -40,13 +41,14 @@ public class RewriteJob extends BatchRulesJob { public RewriteJob(CascadesContext cascadesContext) { super(cascadesContext); ImmutableList<Job> jobs = new ImmutableList.Builder<Job>() - .add(bottomUpBatch(ImmutableList.of(new MergeConsecutiveProjects()))) - .add(topDownBatch(ImmutableList.of(new ExpressionNormalization()))) - .add(topDownBatch(ImmutableList.of(new ReorderJoin()))) - .add(topDownBatch(ImmutableList.of(new PushPredicateThroughJoin()))) + // add rules in reverse order due to jobPool is stack. .add(topDownBatch(ImmutableList.of(new AggregateDisassemble()))) - .build().reverse(); // reverse due to jobPool is stack. - + .add(topDownBatch(ImmutableList.of(new PushPredicateThroughJoin()))) + .add(topDownBatch(ImmutableList.of(new FindHashConditionForJoin()))) + .add(topDownBatch(ImmutableList.of(new ReorderJoin()))) + .add(topDownBatch(ImmutableList.of(new ExpressionNormalization()))) + .add(bottomUpBatch(ImmutableList.of(new MergeConsecutiveProjects()))) + .build().reverse(); Review Comment: keep order, remove the reverse() -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org