转的这里

 

首先先导出所有的table表

hive -e "use xxxdb;show tables;" > tables.txt

然后再使用hive内置语法导出hive表的建表语句,这里使用的是一个shell

cat tables.txt |while read eachline
do
hive -e "use xxxdb;show create table $eachline" >>tablesDDL.txt
echo ";" >> tablesDDL.txt

done

  

相关文章:

  • 2021-09-23
  • 2021-11-30
  • 2021-11-30
  • 2022-02-08
  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2021-05-26
猜你喜欢
  • 2022-12-23
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-11
相关资源
相似解决方案