Hadoop中mapreduce运行WordCount程序报错Error: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, received org.apache.hadoop.io.LongWritable

 2023-02-26    311  

这个问题是因为map的方法参数与继承mapper定义的参数类型不一致导致的,

Hadoop中mapreduce运行WordCount程序报错Error: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, received org.apache.hadoop.io.LongWritableHadoop中mapreduce运行WordCount程序报错Error: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, received org.apache.hadoop.io.LongWritable应该将Mapper的key参数类型设置成Object,就可以解决这个问题

Hadoop中mapreduce运行WordCount程序报错Error: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, received org.apache.hadoop.io.LongWritable

 

以上所述是小编给大家介绍的Hadoop中mapreduce运行WordCount程序报错Error: java.io.IOException: Type mismatch in key from map: expected org.apache.hadoop.io.Text, received org.apache.hadoop.io.LongWritable,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对77isp云服务器技术网的支持!

原文链接:https://www.77isp.com/post/34636.html

=========================================

https://www.77isp.com/ 为 “云服务器技术网” 唯一官方服务平台,请勿相信其他任何渠道。