查询HiveServer2时Impyla从org.apache.hadoop.hive.ql.exec.mr.MapRedTask返回代码1

时间:2018-08-26 18:27:41

标签: hadoop hive hiveql impyla

我正在使用Impyla来查询HIVE的某些结果,但是,我遇到了这个问题:

来自Impyla:

impala.error.OperationalError: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

以及来自HiveServer2:

WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases.
Query ID = hduser_20180827031927_fdb148b0-725b-434c-a0f8-98b6843d4348
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks not specified. Defaulting to jobconf value of: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=<number>
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=<number>
In order to set a constant number of reducers:
  set mapreduce.job.reduces=<number>
FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask

我的源代码是:

from impala.dbapi import connect
import sys


dbName = sys.argv[1:][0]
query = sys.argv[1:][1]

conn = connect(host='192.168.0.10', port=10000, database=dbName , auth_mechanism='NOSASL' , use_ssl=True)
cursor = conn.cursor()
cursor.execute(query, configuration={'hive.exec.reducers.bytes.per.reducer': '100000', 'hive.auto.convert.join.noconditionaltask':'false','mapreduce.job.reduces':'1','hive.auto.convert.join':'false'})
returnData = []
for row in cursor:
    returnData.append(row[0])
pprint(returnData)

如您所见,我添加了许多配置,但是它不起作用

1 个答案:

答案 0 :(得分:0)

由于您的错误,无法知道发生了什么。

我不确定在impyla中启用调试日志记录,因此您需要转到YARN UI来查找查询。

如果YARN不在运行,我认为您会得到更具描述性的错误,例如“无法提交作业”,尽管该错误可能不是从HiveServer传播的。