Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+6 votes
2 views
in Big Data Hadoop & Spark by (11.4k points)

I just set up  hadoop cluster. Also, I have got hive terminal running on it.

Now, out of all my databases I have altered one of them but now I want to delete it because I don't find it useful anymore. But the problem is arising here, it is not getting deleted. I have used DROP command but it is of no use as the database is still there. I’ve been stuck here for a long time now.

So, I am looking for an alternate method to delete my database.

1 Answer

0 votes
by (32.3k points)
edited by

Working with HDFS here? I have tried this at my end and this worked perfectly for me.

  • To delete the desired database without using Hive terminal, you have to go to the hive database location in hdfs, you will find your database in warehouse directory.

  •  My directory is /usr/hive/warehouse/userme.db

Now, open another terminal for flexibility. 

  • To remove this particular database(for me- userme.db) copy the directory given above and paste on the terminal after typing remove command.

$ hdfs dfs -rm -r /usr/hive/warehouse/userme.db

Now your database is deleted without using Hive terminal.

For more information regarding the same, refer the following link:

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...