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
11 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
2 answers

What is Hive? Is Hive a database?

Hey, HIVE:- Hive is an ETL (extract, transform, load) ...READ MORE

answered May 8 in Big Data Hadoop by Gitika
• 17,130 points
3,934 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
21 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 20 hours ago in Big Data Hadoop by Gitika
• 17,130 points
5 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
• 9,670 points
1,882 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
• 9,670 points
168 views
0 votes
10 answers

hadoop fs -put command?

copy command can be used to copy files ...READ MORE

answered Dec 7, 2018 in Big Data Hadoop by Sujay
9,411 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
678 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
17 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
13 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.