thomasrebele commented on code in PR #6055: URL: https://github.com/apache/hive/pull/6055#discussion_r2323013730
########## ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/HiveCalciteUtil.java: ########## @@ -1272,6 +1272,28 @@ public static boolean hasAllExpressionsFromRightSide(RelNode joinRel, List<RexNo return true; } + /** + * Checks the operands in the join conditions are from right side or only from left side. + * + * @param joinRel Join node + * @return true if the join condition operands are from right and left side, false otherwise. + */ + public static boolean hasJoinConditionOperandsFromLeftAndRightSide(Join joinRel) { Review Comment: The name of the method does not match what it does, as it checks for the LHS only. I was wondering what happens in SQL when the filter is on the RHS only (e.g., t3.col2=t3.col2 in the scenario of the qfile). It behaves differently when moving the condition from the ON clause to the WHERE clause: [SQL fiddle](https://sqlfiddle.com/postgresql/online-compiler?id=074f8ebd-a80b-4d0f-8cb2-428a4310af68). Maybe we need to check whether Hive's AntiJoin works correctly in such a case. An alternative name for the method is hasNoJoinConditionConjunctOnLeftSideOnly. Though maybe we can come up with something better. -- 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: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For additional commands, e-mail: gitbox-h...@hive.apache.org