Key filters + link walking

Jason J. W. Williams jasonjwwilliams at gmail.com
Mon Mar 14 16:40:29 EDT 2011


On Mon, Mar 14, 2011 at 2:01 PM, Dan Reverri <dan at basho.com> wrote:

> Hi Jason,
>
> The reduce_identity function expects a two element tuple or a two element
> list; you can see this by looking at the pattern matching in the function:
> https://github.com/basho/riak_kv/blob/master/src/riak_kv_mapreduce.erl#L141
>
> A link phase returns a three element list (["bucket", "key", "tag"]). The
> reduce_identity function should probably be updated to handle the output of
> a phase. In the mean time you can use the reduce_set_union function instead:
> {
> "inputs":{
>      "bucket":"bucket",
>      "key_filters":[["neq", "foo"]]
>   },
> "query":[
> {"link":{}},
> {"reduce":{"language":"erlang","module":"riak_kv_mapreduce",
> "function":"reduce_set_union"}}
> ]
> }
>
> Thanks,
> Dan
>
> Daniel Reverri
> Developer Advocate
> Basho Technologies, Inc.
> dan at basho.com
>
>
Hi Dan,

Thank you. That helps a lot. Trying to use the built-in Erlang reduce
functions for txRiakIdx until the bug with Key Filters + JS reduce phase get
fixed.

-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20110314/7eb33368/attachment.html>


More information about the riak-users mailing list