Sahil Takiar created HIVE-14705: ----------------------------------- Summary: Hive outer queries is not picking up the right column from subqueries Key: HIVE-14705 URL: https://issues.apache.org/jira/browse/HIVE-14705 Project: Hive Issue Type: Bug Affects Versions: 1.1.0 Reporter: Sahil Takiar Fix For: 2.0.1
The following queries show the bug: *Setup:* {code} create table test (a int); insert into test values (7); {code} *Produces Wrong Results:* {code} select * from (select a-1 as a from test where a=7) z; +------+--+ | z.a | +------+--+ | 7 | +------+--+ {code} *Produces Correct Results:* {code} select * from (select a-1 as a1 from test where a=7) z; +-------+--+ | z.a1 | +-------+--+ | 6 | +-------+--+ {code} Note this only happens with subqueries, as the following query returns the correct value of 6 {{select a-1 as a from test where a=7}} This affects version 1.1.0 but has been fixed in version 2.1.0 by HIVE-13602 -- This message was sent by Atlassian JIRA (v6.3.4#6332)