[ https://issues.apache.org/jira/browse/HIVE-9513?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14319562#comment-14319562 ]
Ashutosh Chauhan commented on HIVE-9513: ---------------------------------------- I tried query as posted and it failed to compile on various DBs (except mysql) : {code} create table staging (a int, b int); select * from ( select * from ( select 1 as id , "foo" as str_1 from staging ) f union all select * from ( select 2 as id , "bar" as str_2 from staging ) g ) e ; {code} * Postgres 9.3 : ERROR: column "foo" does not exist: select * from ( select * from ( select 1 as id , "foo" as str_1 from staging ) f union all select * from ( select 2 as id , "bar" as str_2 from staging ) g ) e * Oracle 11g : ORA-00904: "foo": invalid identifier : select * from ( select * from ( select 1 as id , "foo" as str_1 from staging ) f union all select * from ( select 2 as id , "bar" as str_2 from staging ) g ) e * MS-SQL 2012 : Invalid column name 'foo'.: select * from ( select * from ( select 1 as id , "foo" as str_1 from staging ) f union all select * from ( select 2 as id , "bar" as str_2 from staging ) g ) e * MySQL 5.6 : <Success with EmptyRS>. Given above, we should check SQL standard, should allow this behavior only if standard permits. [~ErwanMAS] Are you migrating some workload to Hive. In that case, on which system you were able to run this query? Else, you were simply playing with Hive. > NULL POINTER EXCEPTION > ---------------------- > > Key: HIVE-9513 > URL: https://issues.apache.org/jira/browse/HIVE-9513 > Project: Hive > Issue Type: Bug > Components: CLI > Affects Versions: 0.13.1 > Reporter: ErwanMAS > Assignee: Navis > Attachments: HIVE-9513.1.patch.txt, HIVE-9513.2.patch.txt > > > NPE duting parsing of : > {noformat} > select * from ( > select * from ( select 1 as id , "foo" as str_1 from staging.dual ) f > union all > select * from ( select 2 as id , "bar" as str_2 from staging.dual ) g > ) e ; > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)