Hive Dropping a not empty database

0 votes

Hi. How can I drop a non-empty database? I have some tables in the database and when I try to drop it using the below command:

DROP DATABASE employee;

I get an error telling that the database cannot be dropped because it is not empty.

May 20, 2019 in Big Data Hadoop by Rishi
2,854 views

1 answer to this question.

0 votes

This behavior is because Hive by default doesn't let you drop database containing any tables. There are two modes of dropping databases in Hive: RESTRICT and CASCADE. By default, Hive is in RESTRICT mode and if you want to drop a database with tables, then you'll have to use the CASCADE mode. Refer to the below command:

DROP DATABASE employee CASCADE;
answered May 20, 2019 by Rakshit

Related Questions In Big Data Hadoop

0 votes
3 answers

What is Hive? Is Hive a database?

Hive is a data Warehouse infrastructure/system built ...READ MORE

answered Jul 1, 2019 in Big Data Hadoop by Ved Gupta
23,725 views
0 votes
1 answer

How to create a Hive Database and store it in HDFS?

You will have to exclusively mention the ...READ MORE

answered May 20, 2019 in Big Data Hadoop by Jishnu
2,588 views
0 votes
1 answer

What is the significance of ‘IF EXISTS” clause while dropping a table in Hive?

Hi, Since the table being dropped does not ...READ MORE

answered Jun 26, 2019 in Big Data Hadoop by Gitika
• 65,770 points
2,874 views
0 votes
1 answer
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
11,029 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,536 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,832 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,350 points
4,612 views
0 votes
1 answer

Hive: "SET LOCATION" command not changing the location of the database

The SET LOCATION command does not change ...READ MORE

answered May 20, 2019 in Big Data Hadoop by Yash
3,371 views
0 votes
1 answer

Not able to create database in HIVE

The namenode is in safemode which is ...READ MORE

answered May 24, 2019 in Big Data Hadoop by Sunny
1,513 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP