924060929 commented on code in PR #42064: URL: https://github.com/apache/doris/pull/42064#discussion_r1809790719
########## fe/fe-core/src/main/java/org/apache/doris/nereids/rules/implementation/AggregateStrategies.java: ########## @@ -492,6 +494,22 @@ private boolean checkSlotInOrExpression(Expression expr, Set<Slot> aggSlots) { return true; } + private boolean checkIsNullExpr(Expression expr, Set<Slot> aggSlots) { + if (expr instanceof IsNull) { + Set<Slot> slots = expr.getInputSlots(); + if (slots.stream().anyMatch(aggSlots::contains)) { + return false; + } + } else { + for (Expression child : expr.children()) { + if (!checkIsNullExpr(child, aggSlots)) { + return false; + } + } + } + return true; + } Review Comment: a shorter implementation: ```java private boolean checkIsNullExpr(Expression expr, Set<Slot> aggSlots) { return expr.anyMatch(e -> { if (e instanceof IsNull) { Set<Slot> slots = ((IsNull) e).getInputSlots(); if (slots.stream().anyMatch(aggSlots::contains)) { return true; } } return false; }); } ``` -- 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