#!/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
扫码关注我们
微信号:SRE实战
拒绝背锅 运筹帷幄