java.io.IOException: Type mismatch in value from map: expected org.apache.hadoop.hive.serde2.columna

写MR的时候遇到一个问题,大致的内容如下:


java.io.IOException: Type mismatch in value from map: expected org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable, recieved org.apache.hadoop.io.Text
	at org.apache.hadoop.mapred.MapOutputBuffer2.collect(MapOutputBuffer2.java:280)
	at org.apache.hadoop.mapred.lib.IdentityMapper.map(IdentityMapper.java:37)
	at org.apache.hadoop.mapred.MapRunner.run(MapRunner.java:66)
	at org.apache.hadoop.mapred.MapTask.run(MapTask.java:468)
	at org.apache.hadoop.mapred.Child.main(Child.java:245)

字面意思也很好理解,是类型不匹配。

找到一篇相关的文章 hadoop问题Type mismatch in value from map解决方法

发现是我忘记写

        job.setOutputKeyClass(Text.class);
        job.setOutputValueClass(IntWritable.class);

添加之后问题解决!

你可能感兴趣的:(hadoop)