问题描述
我正在尝试调整现有问题以满足我的需求..
I am trying to tweak an existing problem to suit my needs..
基本上输入是简单的文本我处理它并将键/值对传递给reducer我创建了一个 json .. 所以有关键但没有价值所以映射器:
Basically input is simple text I process it and pass key/value pair to reducer And I create a json.. so there is key but no value So mapper:
输入:文本/文本
输出:文本/文本
缩减器:文本/文本
输出:文本/无
我的签名如下:
但在执行时我收到此错误:
But on execution i am getting this error:
推荐答案
你没有指定你的地图输出类型,所以它和你为你的 reducer 设置的一样,是 Text
和NullWritable
这对您的映射器不正确.您应该执行以下操作以避免任何混淆,最好为 mapper 和 reducer 指定所有类型:
You haven't specified your map output types, so it's taking the same as you set for your reducer, which are Text
and NullWritable
which is incorrect for your mapper. You should do the following to avoid any confusing it's better to specify all your types for both mapper and reducer:
这篇关于映射中的值类型不匹配:预期 org.apache.hadoop.io.NullWritable,收到 org.apache.hadoop.io.Text的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!