Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.2.1
-
None
-
hive-1.2.1
Description
create view on table with union work well while "union all" failed with table not found, here are the reproduce steps.
_hive> create table foo(id int);_ _OK_ _Time taken: 0.401 seconds_ _hive> create table bar(id int);_ _OK_ _// view on table union_ _hive> create view unionview as with tmp_1 as ( select * from foo ), tmp_2 as (select * from bar ) select * from tmp_1 union select * from tmp_2;_ _OK_ _Time taken: 0.517 seconds_ _hive> select * from unionview;_ _OK_ _Time taken: 5.805 seconds_ _// view on union all_ _hive> create view unionallview as with tmp_1 as ( select * from foo ), tmp_2 as (select * from bar ) select * from tmp_1 union all select * from tmp_2;_ _OK_ _Time taken: 1.535 seconds_ _hive> select * from unionallview;_ _FAILED: SemanticException Line 1:134 Table not found 'tmp_1' in definition of VIEW unionallview [_ _with tmp_1 as ( select `foo`.`id` from `default`.`foo` ), tmp_2 as (select `bar`.`id` from `default`.`bar` ) select `tmp_1`.`id` from tmp_1 union all select `tmp_2`.`id` from tmp_2_ _] used as unionallview at Line 1:14_ _
_