Forming inputs to MR job

Timur Fayruzov timur.fairuzov at
Wed Dec 30 14:59:51 EST 2015


I'm trying to write a simple MR job using Javascript and hit a wall right
at start. I can't figure out how to specify "inputs". Here's the code:
curl -XPOST "my_riak_server:8098/mapred" -H "Content-Type:
application/json" -d @- <<EOF
  "input": "my_bucket"
        "source":"function(riakObject, keydata, arg) {
            var m = riakObject.values[0].data;
            return [m];

this returns empty array.

Aside: I know that listing all keys is slow but for now I can live with

Note, that I'm using non-default bucket type, so the actual location of my
keys is my_riak_server/types/my_bucket_type/buckets/my_bucket/my_key, but I
can't figure out how to communicate this location properly in the "input"
field. I have found this "documentation":,
but it does not explain how to specify bucket type and I'm not proficient
enough in Erlang to follow the code easily. I did not find any other
documentation on this field.

Following returns all keys successfully, so data is there:
curl '

Any pointers are highly appreciated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the riak-users mailing list