0

我试图在一堆蜂巢表上运行描述,并想创建一堆 cte,然后将它们联合起来。像这样的东西:

With t1 as (describe sch1.tab1)
, t2 as (describe sch1.tab2)
, t3 as (describe sch1.tab3)
select *
from t1 UNION
select *
from t2 UNION
select * 
from t3

不幸的是,当我尝试这样做时出现此错误:

Error while compiling statement: FAILED: ParseException line 1:15 Failed to recognize predicate 'describe'. Failed rule: 'identifier' in table name 

关于如何做到这一点的任何建议?

4

1 回答 1

0

您可以在 .hql 中添加所有描述命令,并使用sort -u命令执行.hql UNION

hive -f desc_tables.hql  | sort -u
于 2018-01-25T17:31:43.823 回答