Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

p165 chain fold. maybe code error: outkey should be key+reputation not value+ #2

Open
zqhxuyuan opened this issue Mar 6, 2015 · 0 comments

Comments

@zqhxuyuan
Copy link

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant