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

drop database command flushing other data outside db folder

drop database command flushing other data outside db folder

New Contributor

On running the below command to create new database:

create database abc location /users/hive/warehouse/project_name/;

here expected is, this command should create a new db folder named abc.db under project_name directory, but with hive version 1.2.1000.2.6.3.0-235 its not creating abc.db folder.

And on running command drop database abc; the entire project_name directory got deleted from HDFS. So here drop command rather than dropping just one db it deleted whole directory and just retained meta informations in hive metastore for other dbs present in project_name directory.

2 REPLIES 2

Re: drop database command flushing other data outside db folder

Mentor

@Neeraj Maheshwari

What is the value of hive.metastore.warehouse.dir?

Else there is a small variation in your command can you run the below and share the results, this should create a database abc in the path not the quotes and no '/' after the directory !!

create database abc location '/users/hive/warehouse/project_name';

Hope that helps

Re: drop database command flushing other data outside db folder

New Contributor

@Geoffrey Shelton Okot

With this command also its not creating db folder. The only way I can get db folder abc.db is when I specified location like '/users/hive/warehouse/project_name/abc.db'.


Here my concern is when we create database with '/users/hive/warehouse/project_name/' (or just project_name) and drop it then rather than deleting content specific to database abc it delete all content of project_folder.