On 07/05/13 22:06, kurt campher wrote:
http://stackoverflow.com/questions/16359656/riak-map-reduce-in-js-returning-limited-data
I am trying to understand the re-reduce aspect with Riak. Riak reduces
mapped data in stages/batches (default:20) and apparently the reduce
function needs to take this into account.
After much googling I have not found any examples of "js/python
re-reduce in action".
The input bucket has over 100 keys but after the reduce function the
result has only 2 values.
This has been attributed to the reduce needing to be run multiple times
and "/Every iteration gets a batch of results from preceding phase
together with any output from earlier reduce phase iteration(s)./"
The key thing you need to understand is that during the reduce phase,
your function will be called repeatedly, and the input might be the
output from a map phase OR the output from a previous reduce phase.
For instance, you could see something like this happen:
(this is a bit oversimplified but makes my point)
a = map()
b = map()
c = map()
p = reduce(a,b)
r = reduce(p, c)
Look at the inputs to that that last reduce function.
-Toby
_______________________________________________
riak-users mailing list
[email protected]
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com