use metastore
;
select d.name as db_name
,t.tbl_name
,c.integer_idx + 1 as col_position
,c.column_name
,c.type_name
from DBS as d
join TBLS as t
on t.db_id =
d.db_id
join SDS as s
on s.sd_id =
t.sd_id
join COLUMNS_V2 as c
on c.cd_id =
s.cd_id
where d.name like 'my\_db\_%'
order by d.name
,t.tbl_name
,c.integer_idx
;
2条答案
按热度按时间iecba09b1#
您可以创建一个shell脚本并用参数调用它。例如,下面的脚本接收schema,准备schema中的表列表,调用describe extended命令,提取位置,打印schema中按名称排序的前1000个表的表位置。可以将其作为单个命令进行修改和使用:
0s0u357o2#
查询元存储
演示
Hive
mysql(元存储)