mdayakar commented on code in PR #6055:
URL: https://github.com/apache/hive/pull/6055#discussion_r2324407561
##########
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:
Method name is changed to `checkIfJoinConditionOnlyUsesLeftOperands`, I feel
this is ok which resembles the method implementation logic.
> 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.
In the above case it will not be converted to anti join. May be we can check
the Hive's behaviour separately in the above case, if found any issue a bug can
be raised and fixed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]