xzj7019 commented on code in PR #40878: URL: https://github.com/apache/doris/pull/40878#discussion_r1776519670
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/PullUpPredicates.java: ########## @@ -153,14 +155,35 @@ public ImmutableSet<Expression> visitLogicalFilter(LogicalFilter<? extends Plan> @Override public ImmutableSet<Expression> visitLogicalJoin(LogicalJoin<? extends Plan, ? extends Plan> join, Void context) { return cacheOrElse(join, () -> { - Set<Expression> predicates = Sets.newHashSet(); - ImmutableSet<Expression> leftPredicates = join.left().accept(this, context); - ImmutableSet<Expression> rightPredicates = join.right().accept(this, context); - predicates.addAll(leftPredicates); - predicates.addAll(rightPredicates); - if (join.getJoinType() == JoinType.CROSS_JOIN || join.getJoinType() == JoinType.INNER_JOIN) { - predicates.addAll(join.getHashJoinConjuncts()); - predicates.addAll(join.getOtherJoinConjuncts()); + Set<Expression> predicates = new LinkedHashSet<>(); + Supplier<ImmutableSet<Expression>> leftPredicates = Suppliers.memoize( + () -> join.left().accept(this, context)); + Supplier<ImmutableSet<Expression>> rightPredicates = Suppliers.memoize( + () -> join.right().accept(this, context)); + switch (join.getJoinType()) { + case CROSS_JOIN: + case INNER_JOIN: { Review Comment: how about the full outer? -- 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