On Wed, Nov 30, 2011 at 4:28 PM, Sajithkumar Kizhakkiniyil
<sajithkumar.kizhakkini...@apollogrp.edu> wrote:
> If my understanding is correct a reduce phase with
> riak_kv_mapreduce.reduce_identity is needed for secondary index query.

Hi, Sajithkumar.  The reduce_identity function is only needed if the
result you want is the list of bucket/key pairs.  If you are instead
extracting the value of the object in a map phase, you can leave the
reduce_identity call out.

In fact, reduce_identity's proclivity for bucket/key pairs is the
reason your MapReduce query is so slow when reduce_identity is tacked
on the end.  That function throws an exception for any input it gets
that is *not* a bucket/key pair.  If you look in your Riak log, you'll
likely see hundreds of messages along the lines of
"throw:{unhandled_entry,…} reducing: …".  The reason you get your
expected result back instead of an error is a fluke caused by this
known issue: https://issues.basho.com/show_bug.cgi?id=1185

If you're mapping over the objects generated by a 2i query, leave
reduce_identity out, and your query will be much happier.

-Bryan

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

Reply via email to