Pengcheng Xiong created HIVE-10698:
--------------------------------------

             Summary: query on view results fails with table not found error if 
view is created with subquery alias (CTE).
                 Key: HIVE-10698
                 URL: https://issues.apache.org/jira/browse/HIVE-10698
             Project: Hive
          Issue Type: Bug
            Reporter: Pengcheng Xiong


To reproduce it, 

{code}
use bugtest;
create table basetb(id int, name string);
create view testv1 as
with subtb as (select id, name from bugtest.basetb)
select id from subtb;
use castest;
explain select * from bugtest.testv1;
hive> explain select * from bugtest.testv1;
FAILED: SemanticException Line 2:15 Table not found 'subtb' in definition of 
VIEW testv1 [
with subtb as (select id, name from bugtest.basetb)
select id from `bugtest`.`subtb`
] used as testv1 at Line 1:22
Note that there is a database prefix `bugtest`.`subtb`
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to