hive--删除表中的数据truncate

来源:互联网 发布:歌曲字幕制作软件 编辑:程序博客网 时间:2024/05/17 08:51

delect:用于删除特定行条件,你可以从给定表中删除所有的行

TRUNCATE:truncate用于删除所有的行,这个行为在hive元存储删除数据是不可逆的

DROP:删除hive中的表


truncate 不能删除外部表!因为外部表里的数据并不是存放在Hive中的warehouse中

truncate table table_name;

例子:

truncate table employees;


另外一种方法:

insert overwrite table table_name select * from table_name where 1=0;

0 0