select t.* from (select a.*,b.tid tid from tA a left join tB b on tA.cid = tB.cid ) t where t.tid = 'xxx';
excute the sql explain,we found the filter `where t.tid = 'xxx'` excuted when scan table tB,but that's not what I wanted，I hope the filter excuted after the `left join` action
the explain is correct when excuted in hive
How to solve this problem in impala？
Agree with the comment from Tomas79, the filter will convert the LEFT JOIN to an INNER JOIN. I found this post helpful in explaining the behavior: http://wiki.lessthandot.com/index.php/WHERE_conditions_on_a_LEFT_JOIN
You mentioned that things work correctly in Hive, what version of Hive are you using? I checked apache/hive master branch and it follows the same behavior as Impala.