0
votes

Currently I can successfully connect and run queries from Python on HIVE using hive_utils doing the following:

import hive_utils     

query = """ select * from table
            where partition = x 
""" 

conn = hive_utils.HiveClient(server=x, port=10000,db='default')

a = conn.execute(query)
a = list(a)

Queries that include conditional statements however (and that work over HUE) such as:

 query = """ select * from table
             where partition = x
             and app_id = y
 """ 

have returned this error:

HiveServerException: errorCode=1, message='Query returned non-zero code:1' cause: FAILED: Execution Error return code 1 from org.apache.hadoop.hive.ql.exec.MapRedTask SQLState=’08S01’

Since i am not sending any kind of user information when i establish a connection, I suspect the error is due to the type of permissions available to whichever user is being set.

How do I identify myself as a particular user?

1

1 Answers

0
votes

Please refer to the following:

Re: FAILED: Execution Error, return code -101 from org.apache.hadoop.hive.ql.exec.MapRedTask

Most relevant section is:

Go to this link :
http://docs.amazonwebservices.com/ElasticMapReduce/latest/DeveloperGuide/UsingEMR_Hive.html


and add

hadoop-0.20-core.jar
hive/lib/hive-exec-0.7.1.jar
hive/lib/hive-jdbc-0.7.1.jar
hive/lib/hive-metastore-0.7.1.jar
hive/lib/hive-service-0.7.1.jar
hive/lib/libfb303.jar
lib/commons-logging-1.0.4.jar
slf4j-api-1.6.1.jar
slf4j-log4j12-1.6.1.jar


to the class path of your project , add this jars from the lib of hadoop
and hive, and try the code. and also add the path of hadoop, hive, and
hbase(if your are using) lib folder path to the project class path, like
you have added the jars.