We see the following problem on 1.1.0 and 1.2.0 but not 0.13 which seems like a regression.
The following query (Q1) produces no results:
While this one (Q2) does produce results :
The setup to test this is:
I realize select * and select s are not all that interesting in this context but what lead us to this issue was select count(distinct s) was not returning results. The above queries are the simplified queries that produce the issue.
I will note that if I convert the inner join to a table and select from that the issue does not appear.
Update: Found that turning off hive.optimize.remove.identity.project fixes this issue. This optimization was introduced in https://issues.apache.org/jira/browse/HIVE-8435