hive删除数据、删除分区、删除库表

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接: https://blog.csdn.net/Romantic_sir/article/details/102610027
--  删除库
drop database if exists db_name;
--  强制删除库
drop database if exists db_name cascade;

--  删除表
drop table if exists employee;

--  清空表
truncate table employee;
--  清空表,第二种方式
insert overwrite table employee select * from employee where 1=0; 

--  删除分区
alter table employee_table drop partition (stat_year_month>='2018-01');

--  按条件删除数据
insert overwrite table employee_table select * from employee_table where id>'180203a15f';

猜你喜欢

转载自blog.csdn.net/Romantic_sir/article/details/102610027