Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive Throws Database already exists error while creating new database

Highlighted

Hive Throws Database already exists error while creating new database

Contributor

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

Re: Hive Throws Database already exists error while creating new database

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

Highlighted

Re: Hive Throws Database already exists error while creating new database

Rising Star

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
Don't have an account?
Coming from Hortonworks? Activate your account here