MapReduce Weird Issue

Bryan Fink bryan at
Tue Nov 29 07:52:21 EST 2011

On Tue, Nov 29, 2011 at 3:56 AM, Yehuda Zargrov <Yehuda at>
wrote:>      .reduce("function(v) {var s={}; for(var i in v)  { var
date=''; var> sum=0; for(var n in v[i]) { if (n === \"date\")
date=v[i][n]; if (n ===> \"sum\") sum=v[i][n]; } if (date in s)
s[date] += sum; else s[date] = sum; }> return[v]; }", :keep =>
Hi, Yehuda.  I think one of the troubles you're seeing may be
becausethe last statement in your reduce function is "return[v]".  It
lookslike you actually wanted "return[s]".  The function is returning
itsinputs instead of its computation result.
As for why you only see 13 entries instead of hundreds, I'd bet
thateither an error or timeout occurred, and caused a known bug
(whereinputs are returned instead of outputs) to raise its
There may be more information in Riak's logs.  Please write back
withwhat you find, and include the version numbers you're using for
Riakand Ripple.


More information about the riak-users mailing list