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
20 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
5,101 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
37 views
0 votes
1 answer
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,490 points
2,306 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,490 points
237 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
11,899 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,240 points
880 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
30 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
22 views