Ping: Using Erlang funs for map reduce via the REST API and protocol buffers client

Seth Falcon seth at
Wed Oct 6 15:52:18 EDT 2010

Hey all,

I have a patch that allows you to specify Erlang funs as strings for
use in map/reduce via both the REST and protocol buffer APIs.  So you
can do things like:

## For REST

fun(ValueList, _Arg) ->
  [lists:foldl(fun erlang:'+'/2, 0, ValueList)]

## For pb

Mapper = "fun(G, _X, _Y) ->
  O = riak_object:get_value(G),
  [proplists:get_value(blah, O)]

riakc_pb_socket:mapred(Pid, Input, [{map, {strfun, Mapper}, unset, true}]).

I posted a note about this to the list a month ago, but haven't
received any response.  Curious if this is of interest to other users.
Basho team, comments?

Link to original post:


+ seth

Seth Falcon | @sfalcon |

More information about the riak-users mailing list