englefly commented on code in PR #11812: URL: https://github.com/apache/doris/pull/11812#discussion_r950128481
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/MultiJoin.java: ########## @@ -51,11 +54,27 @@ public class MultiJoin extends PlanVisitor<Void, Void> { * A B */ public final List<Plan> joinInputs = new ArrayList<>(); - public final List<Expression> conjuncts = new ArrayList<>(); + public final List<Expression> conjunctsForAllHashJoins = new ArrayList<>(); + private List<Expression> conjunctsKeepInFilter = new ArrayList<>(); + + /** + * reorderJoinsAccordingToConditions + * @return join or filter + */ public Plan reorderJoinsAccordingToConditions() { Preconditions.checkArgument(joinInputs.size() >= 2); - return reorderJoinsAccordingToConditions(joinInputs, conjuncts); + Plan joinRoot = reorderJoinsAccordingToConditions(joinInputs, conjunctsForAllHashJoins); + if (!conjunctsKeepInFilter.isEmpty()) { + LogicalFilter filter = new LogicalFilter( + ExpressionUtils.and(conjunctsKeepInFilter), + joinRoot + ); + return filter; + } else { + return joinRoot; + } + Review Comment: done -- 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