hive刪除表中部分資料

2021-10-24 05:27:01 字數 498 閱讀 3208

insert overwrite table table_name

select * from table_name where ...;

可以看出,刪除的本質就是覆蓋,選出符合條件的結果重新寫表。

1、刪除某個分割槽

alter table table_name drop partition(dt='2020-09-02');
目的是將分割槽為 2020-09-02 的資料全部刪掉,即刪除整個分割槽。

2、刪除某個分割槽中的一部分資料

insert overwrite table table_name partition(dt='2020-09-02') 

select column1,column2,column3 from table_name

where dt='2020-09-02' and column3 is not null;

Hive表刪除表部分資料

1 hive表刪除資料不能使用deletefrom table name 中sql語句 2 hive表刪除資料要分為不同的粒度 table partition partition內 alter table table name drop partition partiton name value i...

Oracle 刪除大表中部分資料

需求 專案中有一張表大概有7000多萬條資料,造成表空間已滿,需要清理部分資料,打算清理3000萬。2b 做法 delete from table name where id 40000000 備註 select count 1 from table name where id his batch ...

hive表如何刪除部分資料

hive 表刪除部分資料不支援使用 delete from table name where 語句 hive表刪除資料要分為不同的粒度 table partition partition內 有分割槽欄位的資料表,刪除資料時要注意分兩種情況 1 根據分割槽刪除資料,可以刪除滿足條件的分割槽,具體 格式...