Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Hive Throws Database already exists error while creating new database

avatar
Rising Star

Hi All,

Hive throws error while creating new database.But after giving this error it is creating the Data Base .

create database test_1; FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTa sk. Database test_1 already exists

It is also giving error while dropping the database .

drop database test_1; FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTa sk. MetaException(message:java.lang.NullPointerException)

Any help appreciated .

Thanks in advance .

2 REPLIES 2

avatar

Try DROP DATABASE IF EXISTS test_1 CASCADE; I hope it works. If not please share the detail logs.

avatar
Expert Contributor

Try the below steps :

1.CREATE DATABASE IF NOT EXISTS test_1

2. DROP DATABASE IF EXISTS test_1 CASCADE

3.I see the error message has Meta Exception, so guessing it could be because of metastore not running. So do this

service hive-metastore status

check for the result is not process not started or metastore dead then restart the service

service hive-metastore start