查看hive表的所有建表语句并保存

3个文件:

tablesDDL.sh
tablesName.txt
tablesName.txt
dim_pub_bigarea_df
dim_pub_bigarea_df_temp
dim_pub_bus_pline_df
dim_pub_business_industry_groups_classification_df
dim_pub_business_industry_groups_classification_df_temp
tablesDDL.sh
#!/bin/bash
cat /root/hivedata/tablesName.txt | while read tableName
do
hive -e "use ddi; show create table $tableName" >> /root/hivedata/tablesDDL.sql
done

然后,   

chmod  777  tablesDDL.txt
bash  tablesDDL.txt

生成整库ddi的建表语句文档

tablesDDL.sql

 

posted @   一只艾米果  阅读(543)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示