drop hive external table after delete data,No way?

2019-08-20 07:17发布

问题:

I have a hive external table. first I delete the hdfs file use hdfs dfs -rm -r /.../tableName ,then I drop the table,Unfortunately,I can't drop the table!

Then I move the file from Trash to table Catalog,aka restore the file,but I also could not drop the table!

now,I can not create a new table ,nor drop the table,what can I do to drop the table ?

回答1:

You can directly delete hdfs file from the hive shell may be it works for safely remove the data.

hive> dfs -rmr /user/hive/warehouse/database_name.db/table_name;

OR

hive> dfs -rm -r /user/hive/warehouse/database_name.db/table_name;

Then you can wipe it completely using DROP TABLE command.



标签: hadoop hive