A MapReduce with out = {reduce: "coll"} should not have a finalize function since its output type does not match the reduce's input type

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 1.7.4
    • Component/s: MapReduce
    • None
    • ALL
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      The 'out' option for mapreduce command can be given the 'reduce' option, which according to the wiki documentation:
      "

      { reduce : 'collectionName' }

      - 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".

              Assignee:
              Unassigned
              Reporter:
              Tony Hannan (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: