gianm commented on a change in pull request #9200: Optimize JoinCondition matching URL: https://github.com/apache/druid/pull/9200#discussion_r367719384
########## File path: processing/src/main/java/org/apache/druid/segment/join/JoinConditionAnalysis.java ########## @@ -133,26 +142,23 @@ public String getOriginalExpression() */ public boolean isAlwaysFalse() { - return nonEquiConditions.stream() - .anyMatch(expr -> expr.isLiteral() && !expr.eval(ExprUtils.nilBindings()).asBoolean()); + return anyFalseLiteralNonEquiConditions; } /** * Return whether this condition is a constant that is always true. */ public boolean isAlwaysTrue() { - return equiConditions.isEmpty() && - nonEquiConditions.stream() - .allMatch(expr -> expr.isLiteral() && expr.eval(ExprUtils.nilBindings()).asBoolean()); + return equiConditions.isEmpty() && allTrueLiteralNonEquiConditions; Review comment: It seems like `allTrueLiteralNonEquiConditions` is only used here; how about caching `isAlwaysTrue` directly? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org For additional commands, e-mail: commits-h...@druid.apache.org