首页 > 其他 > 详细

Hive drop table batched

时间:2015-03-18 15:22:30      阅读:330      评论:0      收藏:0      [点我收藏+]

if the hive version not support drop table tablename purge.

your drop table command will move data to .Trash in hdfs.

dfs .Trash;

drop table tablename;

dfs .Trash/Current;

 

#batch drop tables you want in hive.

hive --database databaseName -e "show tables ‘*_evan‘" >>tables.txt;

---read line from txt files

while read line

do

#echo "drop table $line;"

hive --database databasename -e "drop table if exists $line;";

done < tables.txt

#output the drop table tableName to a hql file, then execute the file.

Hive drop table batched

原文:http://www.cnblogs.com/huaxiaoyao/p/4346965.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!