Support Questions

Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

create table script fails when executing from python in hive

New Contributor

I am running multiple jobs with each one creating a table using data queried from other tables.

but few jobs fails even though previously they ran successfully.


sqlalchemy.exc.OperationalError: (pyhive.exc.OperationalError) TExecuteStatementResp(status=TStatus(statusCode=3, infoMessa
ges=['*org.apache.hive.service.cli.HiveSQLException:Error while processing statement: FAILED: Execution Error, return code
2 from', 'org.apache.hive.service.cli.operation.Operation:toSQLException', '', 'org.apache.hive', 'org.apache.hive.service.cli.operation.Operation:ru', '
39', '', 'org.apache.hive.serv', 'org.apache.hive.service.cli.thrift.ThriftCLIService:ExecuteState', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$ExecuteStatement:getResult:TCLIS', 'org.apache.hive.service.cli.thrift.TCLIService$Processor$
98', '', 'org.apache.thrift.TBaseProcessor:process:TBasePr', 'org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge$Server$TUGIAssumingProcessor:process:HadoopThriftAu', 'org.apache.thrift.server.TThreadPoolServer$', 'java.util.c', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:T', ''], sqlState='08S01', errorCode=2, errorMessage='Error wh
ile processing statement: FAILED: Execution Error, return code 2 from'), opera


the Query is like below

CREATE TABLE <new table> AS
SELECT all_data1.*
<table 1> all_data1
<table 2> all_data2
on all_data1.key1 = all_data2.key2


New Contributor

You need to troubleshoot it below way.

1. execute the select query. Please check few sample data.

2. try to create table using 10 rows.

3. if it is okay, you have to check the rest of the data quality.


Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.