[HIVE]执行HQL的group by操作报Job status not available错误 10C

在公司测试集群上测试hive查询

情况如下:
正常使用查询语句等其他基本语句,没问题,例如

 select * from tablename;// 正常

但是需求中有操作需要分组,需要使用group by操作

 select name from tablename group by name; // 报错

使用java操作和使用beeline操作报同样的错误,执行语句的时候明显感觉到已经执行了,但是最后无法返回结果,报错,完整错误如下

 Error: org.apache.hive.service.cli.HiveSQLException: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask. Job status not available 
    at org.apache.hive.service.cli.operation.Operation.toSQLException(Operation.java:380)
    at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:257)
    at org.apache.hive.service.cli.operation.SQLOperation.access$800(SQLOperation.java:91)
    at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork$1.run(SQLOperation.java:348)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1754)
    at org.apache.hive.service.cli.operation.SQLOperation$BackgroundWork.run(SQLOperation.java:362)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Job status not available 
    at org.apache.hadoop.mapreduce.Job.updateStatus(Job.java:331)
    at org.apache.hadoop.mapreduce.Job.getJobState(Job.java:352)
    at org.apache.hadoop.mapred.JobClient$NetworkedJob.getJobState(JobClient.java:300)
    at org.apache.hadoop.hive.ql.exec.mr.HadoopJobExecHelper.progress(HadoopJobExecHelper.java:251)
    at org.apache.hadoop.hive.ql.exec.mr.HadoopJobExecHelper.progress(HadoopJobExecHelper.java:559)
    at org.apache.hadoop.hive.ql.exec.mr.ExecDriver.execute(ExecDriver.java:424)
    at org.apache.hadoop.hive.ql.exec.mr.MapRedTask.execute(MapRedTask.java:151)
    at org.apache.hadoop.hive.ql.exec.Task.executeTask(Task.java:199)
    at org.apache.hadoop.hive.ql.exec.TaskRunner.runSequential(TaskRunner.java:100)
    at org.apache.hadoop.hive.ql.Driver.launchTask(Driver.java:2183)
    at org.apache.hadoop.hive.ql.Driver.execute(Driver.java:1839)
    at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1526)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1237)
    at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1232)
    at org.apache.hive.service.cli.operation.SQLOperation.runQuery(SQLOperation.java:255)
    ... 11 more (state=08S01,code=1)

2个回答

须配置Job History Server相关参数,让Job Client可以读取job最后的执行状态,测试Hadoop版本2.5.0
添加参数vim mapred-site.xml

mapreduce.jobhistory.address
master.hadoop:10020


yarn.app.mapreduce.am.staging-dir
/tmp/hadoop-yarn/staging


mapreduce.jobhistory.intermediate-done-dir
${yarn.app.mapreduce.am.staging-dir}/history/done_intermediate


mapreduce.jobhistory.done-dir
${yarn.app.mapreduce.am.staging-dir}/history/done

你yarn中去看看executor的执行日志,有可能是内存溢出

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问