The reduce function below contains operation is wrong in Hadoop, could anyone tell me what the problem is and any solution to solve this problem?
pseudo-code is as below:
Algorithm:reduce(String key, Iterator values)
int numDocs = 0
for all v in values do
numDocs += v;
end for
if numDocs < 2 then
return none
end if
for all v in values do
Emit(key,res)
end for