hive批量删除表 shell脚本

#!/bin/sh

database=defult
hive -e "use ${database}; show tables;" |grep order_ |while read line
do
echo -n "drop table ${line};" >> droptables.txt
done
tables=`cat droptables.txt`
echo ${tables}
hive -e "use ${database}; ${tables}"
#rm droptables.txt

猜你喜欢

转载自blog.csdn.net/lunhuasxk/article/details/91808713