问题描述
- mapreduce 求平均数出现错误
-
WARN mapred.JobClient: Error reading task outputSlave1.hadoop
15/08/31 14:18:03 WARN mapred.JobClient: Error reading task outputSlave1.hadoop
15/08/31 14:18:04 INFO mapred.JobClient: Task Id : attempt_201508311326_0003_m_000001_0, Status : FAILED
java.util.NoSuchElementException
at java.util.StringTokenizer.nextToken(StringTokenizer.java:332)
at com.hebut.mr.Score$Map.map(Score.java:37)
at com.hebut.mr.Score$Map.map(Score.java:1)
at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:144)
at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1149)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
解决方案
上传到HDFS的格式不对 ,改为 UTF-8
解决方案二:
Python核心编程2-11习题——求和以及求平均数
时间: 2024-10-02 03:09:28