Utility functions
I was looking at CorrugatedIrons website and I see code like: var query = new RiakMapReduceQuery() .Inputs(BucketName) .MapJs(m = m.Source(@function(o){return[1];})) .ReduceJs(m = m.Name(@Riak.reduceSum).Keep(true)); I am assuming that functions like Riak.reduceSum are general utility functions that are part of the Riak distro. Is there a list of these somewhere documenting their use and purpose? There seems to be both JavaScript and Erlang methods. I would be interested in both. Thank you. ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Utility functions
Built-in Javascript functions are provided in: https://github.com/basho/riak_kv/blob/master/priv/mapred_builtins.js and https://github.com/basho/erlang_js/blob/master/priv/json2.js Built-in Erlang functions are in https://github.com/basho/riak_kv/blob/master/src/riak_kv_mapreduce.erl --- Jeremiah Peschka - Founder, Brent Ozar Unlimited MCITP: SQL Server 2008, MVP Cloudera Certified Developer for Apache Hadoop On Fri, Feb 8, 2013 at 7:41 AM, rkevinbur...@charter.net wrote: I was looking at CorrugatedIrons website and I see code like: var query = new RiakMapReduceQuery() .Inputs(BucketName) .MapJs(m = m.Source(@function(o){return[1];})) .ReduceJs(m = m.Name(@Riak.reduceSum).Keep(true)); I am assuming that functions like Riak.reduceSum are general utility functions that are part of the Riak distro. Is there a list of these somewhere documenting their use and purpose? There seems to be both JavaScript and Erlang methods. I would be interested in both. Thank you. ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com
Re: Utility functions
Kevin: As mentioned in the Riak MapReduce documentation, you can find more information about the pre-built MR jobs here: https://github.com/basho/riak_kv/blob/master/src/riak_kv_mapreduce.erl -- Erlang Module that contains all of the pre-built Erlang MapReduce Phases https://github.com/basho/riak_kv/blob/master/priv/mapred_builtins.js -- JavaScript source of the pre-built JavaScript MapReduce phases Hope this helps, Charle Voiselle On Feb 8, 2013, at 10:41 AM, rkevinbur...@charter.net wrote: I was looking at CorrugatedIrons website and I see code like: var query = new RiakMapReduceQuery() .Inputs(BucketName) .MapJs(m = m.Source(@function(o){return[1];})) .ReduceJs(m = m.Name(@Riak.reduceSum).Keep(true)); I am assuming that functions like Riak.reduceSum are general utility functions that are part of the Riak distro. Is there a list of these somewhere documenting their use and purpose? There seems to be both JavaScript and Erlang methods. I would be interested in both. Thank you. ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com ___ riak-users mailing list riak-users@lists.basho.com http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com