maheshk114 commented on a change in pull request #1147:
URL: https://github.com/apache/hive/pull/1147#discussion_r459215352
##########
File path:
ql/src/java/org/apache/hadoop/hive/ql/optimizer/calcite/rules/HiveJoinAddNotNullRule.java
##########
@@ -74,7 +78,14 @@ public HiveJoinAddNotNullRule(Class<? extends Join> clazz,
@Override
public void onMatch(RelOptRuleCall call) {
Join join = call.rel(0);
- if (join.getJoinType() == JoinRelType.FULL ||
join.getCondition().isAlwaysTrue()) {
+
+ // For anti join case add the not null on right side if the condition is
Review comment:
For the case when we have. join condition which gets evaluated, it will
return false while comparing with a null on the right side. But for always true
join condition, we will not do a match for right side assuming it's always
true. So for anti join, the left side records will not be emitted. To avoid
this we put a null check on right side table and for all null entry, no records
will be projected from right side and thus all records from left side will be
emitted. So the comment is not very accurate. It's like even if the condition
is always true, we add a null check on right side for anti join. I will update
it.
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]