This is an automated email from the ASF dual-hosted git repository. morrysnow pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push: new 82cf76f92b [fix](Nereids) join condition not extract as conjunctions (#20498) 82cf76f92b is described below commit 82cf76f92bccc0bd4148017c0195a8ebd0b4752c Author: morrySnow <101034200+morrys...@users.noreply.github.com> AuthorDate: Tue Jun 6 20:34:19 2023 +0800 [fix](Nereids) join condition not extract as conjunctions (#20498) --- .../doris/nereids/rules/expression/ExpressionRewrite.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/ExpressionRewrite.java b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/ExpressionRewrite.java index 3dc61bcbc7..e42f82b13f 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/ExpressionRewrite.java +++ b/fe/fe-core/src/main/java/org/apache/doris/nereids/rules/expression/ExpressionRewrite.java @@ -42,7 +42,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Lists; import java.util.ArrayList; -import java.util.HashSet; import java.util.List; import java.util.Objects; import java.util.Set; @@ -189,7 +188,7 @@ public class ExpressionRewrite implements RewriteRuleFactory { for (Expression expr : hashJoinConjuncts) { Expression newExpr = rewriter.rewrite(expr, context); hashJoinConjunctsChanged = hashJoinConjunctsChanged || !newExpr.equals(expr); - rewriteHashJoinConjuncts.add(newExpr); + rewriteHashJoinConjuncts.addAll(ExpressionUtils.extractConjunction(newExpr)); } List<Expression> rewriteOtherJoinConjuncts = Lists.newArrayList(); @@ -197,7 +196,7 @@ public class ExpressionRewrite implements RewriteRuleFactory { for (Expression expr : otherJoinConjuncts) { Expression newExpr = rewriter.rewrite(expr, context); otherJoinConjunctsChanged = otherJoinConjunctsChanged || !newExpr.equals(expr); - rewriteOtherJoinConjuncts.add(newExpr); + rewriteOtherJoinConjuncts.addAll(ExpressionUtils.extractConjunction(newExpr)); } if (!hashJoinConjunctsChanged && !otherJoinConjunctsChanged) { @@ -233,12 +232,13 @@ public class ExpressionRewrite implements RewriteRuleFactory { public Rule build() { return logicalHaving().thenApply(ctx -> { LogicalHaving<Plan> having = ctx.root; - Set<Expression> rewrittenExpr = new HashSet<>(); ExpressionRewriteContext context = new ExpressionRewriteContext(ctx.cascadesContext); - for (Expression e : having.getExpressions()) { - rewrittenExpr.add(rewriter.rewrite(e, context)); + Set<Expression> newConjuncts = ImmutableSet.copyOf(ExpressionUtils.extractConjunction( + rewriter.rewrite(having.getPredicate(), context))); + if (newConjuncts.equals(having.getConjuncts())) { + return having; } - return having.withExpressions(rewrittenExpr); + return having.withExpressions(newConjuncts); }).toRule(RuleType.REWRITE_HAVING_EXPRESSION); } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org