mesos/spark — Issue #95: Add an accumulating fold operator
Author: mateiz
Created: 2011-11-24 02:05:01+00:00
State: open

Often when reducing we want to add up objects of some type (e.g. vectors), in which case merging them with a sum function as in reduce(_ + _) is inefficient because it creates a new object each time. It would be nice to have a fold operator taking a "zero value" and a "merge" function that takes the result so far and adds an element onto it.