2013-11-22 53 views
0

目前我可以成功連接和運行使用hive_utils做的HIVE從Python中查詢以下內容:HIVE:登錄爲特定用戶

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) 

查詢,其中包括但條件語句(和工作在HUE),如:

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

已經返回該錯誤:

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’

由於我在建立連接時沒有發送任何類型的用戶信息,我懷疑這個錯誤是由於任何用戶正在設置的權限類型。

如何將自己標識爲特定用戶?

回答

0

請參考以下內容:

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

最相關的部分是:

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. 
相關問題