You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Rajkumar Singh (JIRA)" <ji...@apache.org> on 2018/04/20 22:28:00 UTC

[jira] [Created] (HIVE-19259) Create view on tables having union all fail with "Table not found"

Rajkumar Singh created HIVE-19259:
-------------------------------------

             Summary: Create view on tables having union all fail with "Table not found"
                 Key: HIVE-19259
                 URL: https://issues.apache.org/jira/browse/HIVE-19259
             Project: Hive
          Issue Type: Improvement
          Components: Hive
    Affects Versions: 1.2.1
         Environment: hive-1.2.1

 
            Reporter: Rajkumar Singh


create view on table with union work well while "union all" failed with table not found, here are the reproduce steps.

{code}
_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_
_{code}_



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)