-
Type:
Bug
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: 1.7.4
-
Component/s: MapReduce
-
None
-
ALL
-
None
-
0
-
None
-
None
-
None
-
None
-
None
-
None
The 'out' option for mapreduce command can be given the 'reduce' option, which according to the wiki documentation:
"
- If documents exists for a given key in the result set and in the old collection, then a reduce operation (using the specified reduce function) will be performed on the two values and the result will be written to the output collection. If a finalize function was provided, this will be run after the reduce as well."
The problem is the reduce function has type "[a] -> a" but the finalize function has type "a -> b". If you run the same mapreduce that has a finalize function more than once with out =
{reduce: "coll"}, the previous result will have a value of type "b" but the next mapreduce will try to reduce it expecting a value of type "a".