Hive刪除包含表的資料庫

2021-09-25 11:36:43 字數 573 閱讀 6089

當我們這樣子刪除乙個包含表的資料庫時,會顯示失敗:

hive> drop database hive;

failed: execution error, return code 1 from org.apache.hadoop.hive.ql.exec.ddltask. invalidoperationexception(message:database hive is not empty. one or more tables exist.)

解決辦法有兩個:

1)把資料庫裡面的表刪除乾淨了再刪除資料庫

2)在刪除命令後面加上關鍵字cascade,如下:

hive> drop database hive cascade;

oktime taken: 1.222 seconds

hive> show databases;

okdblab

default

myhive

time taken: 0.037 seconds, fetched: 3 row(s)

hive刪除包含表的庫

當刪除乙個庫的時候 若庫裡面有表則提示不能刪除 hive drop database gp1817 dim failed execution error,return code 1 from org.apache.hadoop.hive.ql.exec.ddltask.invalidoperatio...

hive刪除資料庫

hive刪除資料庫 drop database是刪除所有的表並刪除資料庫的語句。它的語法如下 drop database statementdrop database schema if exists database name restrict cascade 下面的查詢用於刪除資料庫。假設要刪除...

HIVE 資料庫臨時表

hive從0.14.0開始提供建立臨時表的功能,表只對當前session有效,session退出後,表自動刪除。語法 create temporary table 注意點 1 如果建立的臨時表表名已存在,那麼當前session引用到該錶名時實際用的是臨時表,只有drop或rename臨時表名才能使用...