delect:用于删除特定行条件,你可以从给定表中删除所有的行????
TRUNCATE:truncate用于删除所有的行,这个行为在Hive元存储删除数据是不可逆的
DROP:删除hive中的表
truncate 不能删除外部表!因为外部表里的数据并不是存放在Hive Meta store中
truncate:
truncate table table_name;
例子:
truncate table employees;
删除行
eg:A表数据如下
id(String) name(String)
----------------------------
1 aaa
2 bbb
3 ccc
-----------------------------
要求删除2 bbb
hive脚本如下:
insert overwrite table A select id,name from A where id !=2;
手机扫一扫
移动阅读更方便
你可能感兴趣的文章