Support Questions
Find answers, ask questions, and share your expertise

Drop database doesn't remove HDFS directory.


When I run the drop database command within impala it doesn't remove the corresponding HDFS files.


               drop database if exists databasename cascade;


I want to drop a database and remove the corresponding hdfs files.


Per the documentaion - 


Removes a database from the system.

The physical operations involve removing the metadata for the database from the metastore, and deleting the corresponding *.db directory from HDFS.


The cascade parameter drops the tables within the database first.


I'm running CDH 513.3 and CM 514.3.





I had the similar issue long back and below was my findings


Please check the owner of HDFS folder/files for the corresponding db that you are trying to delete. if you are the owner and trying to delete the table/db from hive/impala, it will delete both metadata and hdfs file/folder. Whereas you are not the owner of hdfs folder/file but got an access in hive/impala to manage data and trying to delete it, it will just delete the metadata but not the underlined folder/files from hdfs


pls try this with a sample db/table for more understanding

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.