mapreducepatterns
mapreducepatterns copied to clipboard
p165 chain fold. maybe code error: outkey should be key+reputation not value+
UserIdReputationEnrichmentMapper's map method: String reputation = userIdToReputation.get(key.toString()); if (reputation != null) { outkey.set(value.get() + "\t" + reputation); output.collect(outkey, value); } the outputkey is userId\tReputation. as the book sayed: Reducer code. This reducer implementation sums the values together and outputs this summation with the input key: user ID and reputation. so the third line should be: outkey.set(key.toString() + "\t" + reputation);