morrySnow commented on code in PR #11812:
URL: https://github.com/apache/doris/pull/11812#discussion_r951033596
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/rewrite/ExpressionRewrite.java:
##########
@@ -106,15 +107,25 @@ private class JoinExpressionRewrite extends
OneRewriteRuleFactory {
@Override
public Rule build() {
return logicalJoin().then(join -> {
- Optional<Expression> condition = join.getCondition();
- if (!condition.isPresent()) {
+ List<Expression> hashJoinPredicates =
join.getHashJoinPredicates();
+ Optional<Expression> otherJoinCondition =
join.getOtherJoinCondition();
+ if (!otherJoinCondition.isPresent() &&
hashJoinPredicates.isEmpty()) {
return join;
}
- Expression newCondition = rewriter.rewrite(condition.get());
- if (newCondition.equals(condition.get())) {
+ List<Expression> rewriteHashJoinPredicates = new ArrayList<>();
+ boolean joinPredicatesChanged = false;
+ for (Expression expr : hashJoinPredicates) {
+ Expression newExpr = rewriter.rewrite(expr);
+ joinPredicatesChanged = joinPredicatesChanged ||
newExpr.equals(expr);
+ rewriteHashJoinPredicates.add(newExpr);
+ }
Review Comment:
update joinPredicatesChanged is not a problem. But newExpr compare to old
one is hard to do with stream. So ignore this comment pls.
--
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]