Reply
New Contributor
Posts: 1
Registered: ‎04-22-2019

Unable to create table in hive : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.

hive> create table t ( i int );
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Exception thrown when executing query)

 

Unable to create table as I am facing this error .

 

I am using cloudera quick start VM.

 

Thanks in advance.

Highlighted
Cloudera Employee
Posts: 36
Registered: ‎10-04-2017

Re: Unable to create table in hive : FAILED: Execution Error, return code 1 from org.apache.hadoop.h

Hello Abhinav

 

The error message seems generic and there could be multiple reason for this error example service was bad , HMS not able to connect to backend db .

 

1. Please enabled debug level logging if using hive CLI , this will show us the error which is cuaing this failure:

 

Below are the steps to enable debug logging for session level

 

root@hostname ~]# export HADOOP_ROOT_LOGGER=DEBUG,console

[root@hostname ~]# hive --hiveconf hive.root.logger=DEBUG,console  -e "create table test(i int)"

 

2.. Was the hive service up and running when you observed this issue ?

 

To start HiveServer1:
$ sudo service hiveserver start

To start the Hive console:

$ hive
hive>

To confirm that Hive is working, issue the show tables; command to list the Hive tables; be sure to use a semi-colon after the command:

hive> show tables;
OK
Time taken: 10.345 seconds

3.. Did you try using Beeline as well ?  if not could you please try connecting via beeline and let us know if that works

 

Because of concurrency and security issues, HiveServer1 is deprecated in CDH 5 and will be removed in a future release. Cloudera recommends you migrate to Beeline and HiveServer2 as soon as possible. The Hive Console is not needed if you are using Beeline with HiveServer2.

 

https://blog.cloudera.com/blog/2014/02/migrating-from-hive-cli-to-beeline-a-primer/

 

Thanks

Manpreet Singh

 

 

 

 

 

Cloudera Employee
Posts: 737
Registered: ‎03-23-2015

Re: Unable to create table in hive : FAILED: Execution Error, return code 1 from org.apache.hadoop.h

As Manpreet mentioned, it is better to run in Beeline and check the error message in HiveServer2 log, which can tell more about the story.

Eric