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 in Big Data Hadoop by Rishi
52 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 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 in Big Data Hadoop by Ved Gupta
6,458 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 in Big Data Hadoop by Jishnu
58 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 in Big Data Hadoop by Gitika
• 25,340 points
134 views
0 votes
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,690 points
3,097 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,690 points
349 views
0 votes
10 answers

hadoop fs -put command?

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

answered Dec 7, 2018 in Big Data Hadoop by Aditya
15,204 views
0 votes
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,260 points
1,128 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 in Big Data Hadoop by Yash
48 views
0 votes
1 answer

Not able to create database in HIVE

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

answered May 24 in Big Data Hadoop by Sunny
33 views