jackwener commented on code in PR #12497: URL: https://github.com/apache/doris/pull/12497#discussion_r966614018
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/rewrite/logical/PushPredicateThroughJoin.java: ########## @@ -114,22 +113,12 @@ public Rule build() { private Plan pushDownPredicate(LogicalJoin<GroupPlan, GroupPlan> joinPlan, List<Expression> joinConditions, List<Expression> leftPredicates, List<Expression> rightPredicates) { - - Expression left = ExpressionUtils.and(leftPredicates); - Expression right = ExpressionUtils.and(rightPredicates); - //todo expr should optimize again using expr rewrite - Plan leftPlan = joinPlan.left(); - Plan rightPlan = joinPlan.right(); - if (!left.equals(BooleanLiteral.TRUE)) { - leftPlan = new LogicalFilter<>(left, leftPlan); - } - - if (!right.equals(BooleanLiteral.TRUE)) { - rightPlan = new LogicalFilter<>(right, rightPlan); - } + // todo expr should optimize again using expr rewrite + Plan leftPlan = PlanUtils.filterOrSelf(leftPredicates, joinPlan.left()); + Plan rightPlan = PlanUtils.filterOrSelf(rightPredicates, joinPlan.right()); Review Comment: When `BooleanLiteral.TRUE`, it means that `leftPredicates` is empty, so we will return self. -- 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