englefly commented on code in PR #16449: URL: https://github.com/apache/doris/pull/16449#discussion_r1098272279
########## fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java: ########## @@ -311,6 +311,23 @@ public static List<Expression> replaceJoinConjuncts(List<Expression> joinConjunc ).collect(ImmutableList.toImmutableList()); } + /** + * replace JoinConjuncts by using Expression map. Review Comment: "replace JoinConjuncts by Expression map" typo-error ########## fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java: ########## @@ -311,6 +311,23 @@ public static List<Expression> replaceJoinConjuncts(List<Expression> joinConjunc ).collect(ImmutableList.toImmutableList()); } + /** + * replace JoinConjuncts by using Expression map. + */ + public static List<Expression> replaceJoinConjunctsUseExpression(List<Expression> joinConjuncts, + Map<ExprId, Expression> replaceMaps) { + return joinConjuncts.stream() + .map(expr -> + expr.rewriteUp(e -> { + if (e instanceof Slot && replaceMaps.containsKey(((Slot) e).getExprId())) { Review Comment: It is better to use SlotReference as key of replaceMaps instead of exprId. SlotReference.equals() compare Slot by its exprId, so there is no performance loose. ########## fe/fe-core/src/main/java/org/apache/doris/nereids/util/JoinUtils.java: ########## @@ -311,6 +311,23 @@ public static List<Expression> replaceJoinConjuncts(List<Expression> joinConjunc ).collect(ImmutableList.toImmutableList()); } + /** + * replace JoinConjuncts by using Expression map. + */ + public static List<Expression> replaceJoinConjunctsUseExpression(List<Expression> joinConjuncts, Review Comment: "replaceJoinConjunctsByExpressionMap" may be a better name -- 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