hive上批量删除表

#!/bin/sh
hive -e "use china_prod;show tables \"t_tag_political*\";" | while read line
do
echo "drop table $line;">>temptables.txt
done

hive -e "use china_prod;show tables \"tag*\";" | while read line
do
echo "drop table $line;">>temptables.txt
done

tables=`cat temptables.txt`
echo $tables
hive -e "use china_prod;$tables"
rm temptables.txt
posted @ 2019-05-10 11:17  又尘埃  阅读(6099)  评论(0编辑  收藏  举报