Before Hive 0.8.0, the query
would give the error
Here, the filter is applied to the table invites as invites.ds='2011-01-01' but not invites2.ds='2011-01-01'. This causes Hive to reject the query in strict mode to prevent scanning all the partitions of invites2. This can be seen by using explain plan on the query without strict mode on:
Note that there is no filter on the tablescan operation for invites2.
In Hive 0.8.0, support will be added for recognizing transitivity on join conditions during predicate pushdown with [HIVE-1989|https://issues.apache.org/jira/browse/HIVE-1989]. With the above example, Hive will now infer the filter invites2.ds='2011-01-01' from the filter invites.ds='2011-01-01' and the join condition invites.ds=invites2.ds. The explain plan now gives: