打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
hive删除数据

按分区删除:

ALTER TABLE test1  DROP PARTITION (dt='2016-04-29');

 

删除符合条件的数据:

insert overwrite table t_table1 select * from t_table1 where XXXX;

其中xxx是你需要保留的数据的查询条件。

insert overwrite table tlog_bigtable  PARTITION (dt='2017-12-20',game_id = 'id')select * from tlog_bigtable twhere t.dt = '2017-12-20'and t.event_time < '2017-12-20 20:00:00'and t.game_id = 'id'

 

 

 

清空表:

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

 

DROP TABLE [IF EXISTS] table_name  ;

TRUNCATE TABLE table_name

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
hiveinsertinto语句和insertoverwrite语句
hive的insert语句列顺序问题以及新增字段遇到的坑
解决hive表新增的字段查询为空null问题
大数据实战-Hive-技巧实战
Hive 基础之:分区、桶、Sort Merge Bucket Join
Hive的概念
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服