hive中Hql查询时错误


hive> select count(*) from student_info;
Query ID = hadoop_20170127022626_4c071a70-f0d0-484a-8e29-dbd875356ef9
Total jobs = 1
Launching Job 1 out of 1
Number of reduce tasks determined at compile time: 1
In order to change the average load for a reducer (in bytes):
  set hive.exec.reducers.bytes.per.reducer=
In order to limit the maximum number of reducers:
  set hive.exec.reducers.max=
In order to set a constant number of reducers:
  set mapred.reduce.tasks=
Job running in-process (local Hadoop)
2017-01-27 02:26:20,750 Stage-1 map = 0%,  reduce = 0%
2017-01-27 02:26:57,772 Stage-1 map = 100%,  reduce = 100%
Ended Job = job_1485444043128_0007 with errors
Error during job, obtaining debugging information...
Examining task ID: task_1485444043128_0007_m_000000 (and more) from job job_1485444043128_0007
Unable to retrieve URL for Hadoop Task logs. Does not contain a valid host:port authority: local

Task with the most failures(4): 
-----
Task ID:
  task_1485444043128_0007_m_000000

-----
Diagnostic Messages for this Task:
Error: java.lang.NullPointerException
        at org.apache.hadoop.hive.ql.io.HiveInputFormat.init(HiveInputFormat.java:270)
        at org.apache.hadoop.hive.ql.io.HiveInputFormat.pushProjectionsAndFilters(HiveInputFormat.java:484)
        at org.apache.hadoop.hive.ql.io.HiveInputFormat.pushProjectionsAndFilters(HiveInputFormat.java:477)
        at org.apache.hadoop.hive.ql.io.CombineHiveInputFormat.getRecordReader(CombineHiveInputFormat.java:717)
        at org.apache.hadoop.mapred.MapTask$TrackedRecordReader.(MapTask.java:169)
        at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:432)
        at org.apache.hadoop.mapred.MapTask.run(MapTask.java:343)
        at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:163)
        at java.security.AccessController.doPrivileged(Native Method)
        at javax.security.auth.Subject.doAs(Subject.java:415)
        at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1671)
        at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:158)

FAILED: Execution Error, return code 2 from org.apache.hadoop.hive.ql.exec.mr.MapRedTask
MapReduce Jobs Launched: 
Stage-Stage-1:  HDFS Read: 0 HDFS Write: 0 FAIL
Total MapReduce CPU Time Spent: 0 msec

实际上有两个失败:
1)启动集群由于某种原因失败。建议尝试定位失败的任务日志任务在集群上。
2)自动检索任务日志JobTracker TaskLogServlet。这在MR2服务不存在,抛出异常(因为mapred.job。跟踪是未定义的,或者因为它找不到TaskLogServlet mapred.job.tracker的服务的计算机上运行指向)。 

解决办法 
  1、 解决方法:修改hive-site.xml:



    mapreduce.jobtracker.address
    ignorethis

  2、解决办法
In the meantime I recommend doing the following if you need to run Hive on 
MR2: 
* Keep Hive happy by setting mapred.job.tracker to a bogus value. 
* Disable task log retrieval by setting 
hive.exec.show.job.failure.debug.info=false 
解释:
 同时我建议做以下如果你需要运行hive
MR2:
*保持hive箱设置mapred.job快乐。追踪到一个虚假的价值。
*禁用任务日志检索通过设置
hive.exec.show.job.failure.debug.info = false
 
 意思:
 
    hive.exec.show.job.failure.debug.info
    false



3 配置hive时 注意这参数

hive.exec.mode.local.auto
true

你可能感兴趣的:(hive中Hql查询时错误)