#!/bin/bash
hive -S -e "use 数据库名;show tables;" >tables.txt
cat tables.txt | while read eachline
do
hive -S -e "use 数据库名;show create table ${eachline};" >> tablesDDL.hql
done
#!/bin/bash
hive -S -e "use 数据库名;show tables;" >tables.txt
cat tables.txt | while read eachline
do
hive -S -e "use 数据库名;show create table ${eachline};" >> tablesDDL.hql
done