Incorect Input to Reduce

Sean Cribbs sean at basho.com
Wed Nov 30 10:01:37 EST 2011


Hi Yehuda,

Your reduce function is not guaranteed to run across all inputs in the
first application, but may be applied many times as new inputs come in.
Riak will batch up reduce inputs until a certain number or timeout is
reached, then apply the function and take its output to be part of the
inputs for the next application. If it is absolutely necessary to run the
reduce function only once, use "reduce_phase_only_1" as the "arg" (only
works on Riak 1.0.x, example in Ruby):

mr.reduce("function(v){...}", :arg => {:reduce_phase_only_1 => true}, :keep
=> true)

Hope that helps!

On Wed, Nov 30, 2011 at 9:03 AM, Yehuda Zargrov <Yehuda at conduit.com> wrote:

> Hi,****
>
> ** **
>
> I’ve posted a mail on this few days ago, but went a bit further since then.
> ****
>
> ** **
>
> I’m using ripple, running a map function on some input and getting a list
> of about 50 items.****
>
> ** **
>
> Right after that, I’m running a reduce function. The first thing I do in
> it is putting the length of v (the input) as an item in a list.****
>
> ** **
>
> When printing the result I see that the length is 13.****
>
> ** **
>
> It’s like something has happened between the map and reduce phases.****
>
> ** **
>
> Any ideas?****
>
> ** **
>
>   ****
>
> [image: Description:
> C:\Users\Yehuda\AppData\Roaming\Microsoft\Signatures\logo.gif]****
>
> *Yehuda Zargrov**
> *Software Engineer****
>
> *Conduit Your Site* <http://www.conduit.com/>****
>
> *t:* 972.8.9461713 ext +314 |   *m:* +972503473119   |   *f:* +97286382140
> ****
>
>
> This message may contain confidential and/or privileged information. It is
> intended to be read only by the individual or entity to whom it is
> addressed or by their designee.
> If the reader of this message is not the intended recipient, you are on
> notice that any uses, copy, disclose or distribution of this message, in
> any form, is strictly prohibited.
> If you have received this message in error, please notify the sender by
> reply email or by telephone and delete or destroy any copy of this message.
> Thank you.
>
> ****
>
> _______________________________________________
> riak-users mailing list
> riak-users at lists.basho.com
> http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
>
>


-- 
Sean Cribbs <sean at basho.com>
Developer Advocate
Basho Technologies, Inc.
http://www.basho.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20111130/4f347ff8/attachment.html>


More information about the riak-users mailing list