1.登录hive元数据库(此例为oracle数据库)
2.获取hive表结构的语句如下:表名,列序号,列名,列注释,列类型
select a.tbl_name,c.integer_idx+1,c.column_name,c."COMMENT",c.type_name
from TBLS a,SDS b,COLUMNS_V2 c
where owner = 'yourdbname' --你的数据库名
and a.sd_id = b.sd_id and b.cd_id = c.cd_id
and lower(tbl_name) like 'aa_%' --只查找aa开头的表
order by a.tbl_name,c.integer_idx;