While building out functionality in CorrugatedIron to coincide with the Riak 
1.0.0 release, I've run into something a bit odd.

MapReduce phases with a keep set to true are returning in multiple 
RpbMapRedResp messages. I expected this, especially since hte API says it's 
possible. What's causing the issue is the output format.

When I MR via the HTTP API, I get results like this:

[["riak_index_tests","5"],["riak_index_tests","6"],["riak_index_tests","7"],["riak_index_tests","4"],["riak_index_tests","8"],["riak_index_tests","3"],["riak_index_tests","2"],["riak_index_tests","0"],["riak_index_tests","1"],["riak_index_tests","9"]]

When I execute the same MR through the PB API I get results that look like this:

[["riak_index_tests","1"]][["riak_index_tests","6"]][["riak_index_tests","0"]][["riak_index_tests","7"]][["riak_index_tests","8"]][["riak_index_tests","4"]][["riak_index_tests","9"]][["riak_index_tests","2"]][["riak_index_tests","3"]][["riak_index_tests","5"]]

The MR query itself, just to make sure I haven't done something wrong, is this:

curl -H "Content-Type: application/json" $RIAK/mapred     -d @- 
{"inputs":{"bucket":"riak_index_tests","index":"age_int","key":32},"query":[{"reduce":{"language":"erlang","module":"riak_kv_mapreduce","function":"reduce_identity","keep":true}}]}

and this:

{"inputs":{"bucket":"riak_index_tests","index":"age_int","key":32},"query":[{"reduce":{"language":"erlang","module":"riak_kv_mapreduce","function":"reduce_identity","keep":true}}]}

Is there a reason that Riak is returning discrete JSON chunks instead of 
streaming back raw bytes to the client? Is there less documented change in Riak 
1.0 that will prevent this type of behavior (which incidentally didn't crop up 
until the 1.0 pre-release builds).
---
Jeremiah Peschka - Founder, Brent Ozar PLF, LLC
Microsoft SQL Server MVP


_______________________________________________
riak-users mailing list
riak-users@lists.basho.com
http://lists.basho.com/mailman/listinfo/riak-users_lists.basho.com

Reply via email to