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.

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

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

New Contributor

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.

4 REPLIES 4
Highlighted

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

Cloudera Employee

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

 

 

 

 

 

Highlighted

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

Guru
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
Highlighted

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

New Contributor

Creating table throws error but database creation works fine.

(base) [cloudera@quickstart ~]$ beeline -u  jdbc:hive2://quickstart:10000/default --hiveconf hive.root.logger=DEBUG,console  -e "create table test(i int)"

20/03/08 15:55:10 DEBUG util.VersionInfo: version: 2.6.0-cdh5.16.2

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

scan complete in 8ms

Connecting to jdbc:hive2://quickstart:10000/default

Connected to: Apache Hive (version 1.1.0-cdh5.16.2)

 

 

(base) [cloudera@quickstart ~]$ beeline -u  jdbc:hive2://quickstart:10000/default --hiveconf hive.root.logger=DEBUG,console  -e "create database test"

20/03/08 15:57:51 DEBUG util.VersionInfo: version: 2.6.0-cdh5.16.2

OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

scan complete in 5ms

Connecting to jdbc:hive2://quickstart:10000/default

Connected to: Apache Hive (version 1.1.0-cdh5.16.2)

Driver: Hive JDBC (version 1.1.0-cdh5.16.2)

Transaction isolation: TRANSACTION_REPEATABLE_READ

INFO  : Compiling command(queryId=hive_20200308155858_019a49da-ea7d-441c-863d-f37ff4c86d32): create database test

INFO  : Semantic Analysis Completed

INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)

INFO  : Completed compiling command(queryId=hive_20200308155858_019a49da-ea7d-441c-863d-f37ff4c86d32); Time taken: 0.096 seconds

INFO  : Concurrency mode is disabled, not creating a lock manager

INFO  : Executing command(queryId=hive_20200308155858_019a49da-ea7d-441c-863d-f37ff4c86d32): create database test

INFO  : Starting task [Stage-0:DDL] in serial mode

INFO  : Completed executing command(queryId=hive_20200308155858_019a49da-ea7d-441c-863d-f37ff4c86d32); Time taken: 3.029 seconds

INFO  : OK

No rows affected (3.281 seconds)

Beeline version 1.1.0-cdh5.16.2 by Apache Hive

Driver: Hive JDBC (version 1.1.0-cdh5.16.2)

Transaction isolation: TRANSACTION_REPEATABLE_READ

INFO  : Compiling command(queryId=hive_20200308155555_9a444e04-9523-4443-b312-64a94e5a5138): create table test(i int)

INFO  : Semantic Analysis Completed

INFO  : Returning Hive schema: Schema(fieldSchemas:null, properties:null)

INFO  : Completed compiling command(queryId=hive_20200308155555_9a444e04-9523-4443-b312-64a94e5a5138); Time taken: 0.268 seconds

INFO  : Concurrency mode is disabled, not creating a lock manager

INFO  : Executing command(queryId=hive_20200308155555_9a444e04-9523-4443-b312-64a94e5a5138): create table test(i int)

INFO  : Starting task [Stage-0:DDL] in serial mode

ERROR : FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Exception thrown when executing query)

INFO  : Completed executing command(queryId=hive_20200308155555_9a444e04-9523-4443-b312-64a94e5a5138); Time taken: 20.625 seconds

Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Exception thrown when executing query) (state=08S01,code=1)

Highlighted

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

Guru
Please use the query ID hive_20200308155555_9a444e04-9523-4443-b312-64a94e5a5138 and search in HS2 log to find out the exact reason for the failure. Looks like beeline did not capture the full error from server side.

Cheers
Eric
Don't have an account?
Coming from Hortonworks? Activate your account here