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
297 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
11,652 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
165 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
• 29,690 points
817 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
• 10,920 points
5,109 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
• 10,920 points
729 views
+1 vote
11 answers

hadoop fs -put command?

put syntax: put <localSrc> <dest> copy syntax: copyF ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Aditya
30,378 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,310 points
1,904 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
599 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
77 views