Mapred unable to find keys that use bucket types

Mikhail Pustovalov mpustovalov at gmail.com
Thu Feb 5 13:55:09 EST 2015


Hello,
I am using MapReduce just as a way to get multiple keys in one query (I
couldn't find a better way). My code used to work with Riak v.1.4 but now
when I try to run it against the latest version (2.0.4) mapred queries
return {error, notfound} for each key supplied.
I have created a bucket type, put my keys inside a bucket in that type.
Simple 'put' and 'get' work fine. This line returns requested object:
riakc_pb_socket:get(Pid,{<<"avs_n2">>,<<"avatars">>},<<145,3,100,41,46>>).
This line though:
riakc_pb_socket:mapred(Pid,
[{{<<"avs_n2">>,<<"avatars">>},<<145,3,100,41,46>>}],[{map, {modfun,
rc_mapred, map_kv_pairs}, none, true}]).
returns this:
{ok,[{0,[{error,notfound}]}]}
Seems like mapred functions are unable to query using bucket types. Without
bucket types everything still works fine.
Also mapred_bucket over a whole bucket also works fine.
Please, advise. Is it possible to use mapred with newly introduced bucket
types when I want only specific keys and not the full scan of a bucket?

Kind regards,
Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.basho.com/pipermail/riak-users_lists.basho.com/attachments/20150205/1aafe782/attachment-0002.html>


More information about the riak-users mailing list