CDH hive元数据 DBS TBLS COLUMNS_V2视图关系 博客分类: 大数据
程序员文章站
2024-03-12 12:29:44
...
CDH hive元数据 DBS TBLS COLUMNS_V2视图关系
SELECT T.DB_ID,T.NAME,T1.TBL_NAME,T1.TBL_TYPE,T3.COLUMN_NAME,T3.TYPE_NAME,T3.COMMENT,T3.INTEGER_IDX
FROM DBS T,TBLS T1,SDS T2,COLUMNS_V2 T3
WHERE T.DB_ID=T1.DB_ID
AND T.OWNER_NAME =T1.OWNER
AND T1.SD_ID=T2.SD_ID
AND T2.CD_ID=T3.CD_ID
AND T.NAME IN('idw','idwopr','ods')
ORDER BY T.NAME,T1.TBL_NAME,T3.INTEGER_IDX
into outfile '/var/lib/mysql-files/hive_metadata.csv'
fields terminated by '||'
optionally enclosed by '"'
escaped by '"'
lines terminated by '\r\n';