hive中怎麼刪除表中的部分資料

時間 2021-08-30 11:13:07

1樓:曾經我也不想

工具:(1)hive;

(2)電腦;

(3)xshell;

採用hdfs命令進行刪除表中的部分資料:

1、先使用hdfs檢視該表實際分割槽以及資料目錄位置hdfs dfs -ls /user/hive/warehouse/tbdata.db/表名小寫/;

2、例如:使用hdfs命令刪除該分割槽20161124目錄hdfs dfs -rm -r -f   /user/hive/warehouse/tbdata.db/表名小寫/etl_dt=20161124;

3、最後檢視是否有分割槽目錄;

4、最檢視進hive命令列檢視此表是否還有資料。

2樓:吾乃白鶴

hive是不支援更新操作的,你可以這樣子做,從hive表中查詢出你想保留的資料,並且輸入到原來的表中。

3樓:匿名使用者

insert overwrite table t_table1 select * from t_table1 where ***x;

其中***是你需要保留的資料的查詢條件。

如果清空表,如下:

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

sql刪除表中的一行資料,該用什麼sql語句?

4樓:我賣燒餅不賣饃

delete from ms_cf01 where brxm='張三' and id='7598';

其中: ms_cf01 為你所要刪除那條資料所屬的表。

brxm,id 為你所要刪除資料的條件。

sql中如何刪除表中重複的記錄,sql中如何刪除一個表中重複的記錄

sql中刪除一個表中的重複記錄可以採用如下步驟 1 把a dist表的記錄用distinct去重,結果放到臨時表中。select distinct into temp from a dist 2 把a dist表的記錄全部刪除。delete from a dist 3 把臨時表中的資料資訊導進到a ...

怎麼刪除中的標註,怎麼刪除word中的標註,

昂義稱凰 選單 工具 自定義 審閱,如果沒有調出標註的工具欄可以這樣調出。然後選中要刪的,點 拒絕所選修訂 旁邊一個小三角,下拉選單裡還可以清除所有批註。 邰丹康靜 ctrl shift e調出審閱工具欄,去掉 修訂 選中狀態。同時,選擇是否接受已經存在的修訂。 肇夠人設有 如果你只是單純的不想看到...

sql如何把表名中包含某字元的表刪除

以下儲存過程實測通過,不過,使用要小心,很危險,因為會刪除一批表!create procedure deletetables str varchar 100 as declare name varchar 100 select name as 請看一下所有刪除的表 from sysobjects w...