#!/bin/shhive -e "use csxuy;show tables;"|grep product_tour2 | while read linedoecho -n "drop table ...
#!/bin/shhive -e "use csxuy;show tables;"|grep product_tour2 | while read linedoecho -n "drop table ...
...
一.批量添加分区: use bigdata; alter table siebel_member add if not exists partition(dt='20180401') location '20180401 ...
...
第一步:执行 select 'drop table '||table_name||';' as sqlscript from user_tables; 第二部:导出所有的执行结果,生成exc ...
今天需要清理一个很大的数据库,里面表有一堆,而且有很多是空表。想着把数据库弄小点,于是想到一次性删掉所有空表。 废话不多说,上代码。 首先,查处所有的空表。 View Code 然后把查询的表名拼成drop table的语句 ...
hive删除表和表中的数据,以及按分区删除数据 hive删除表: hive删除表中数据: hive按分区删除数据: ...