There is no way to do this directly. If you need joins (2, 3) or unions
(1), the easiest thing that you can do is use Riak Search/Yokozuna to feed
your MapReduce query instead of using a 2i input.

In response to your specific examples:

For #1 you could use an input where index1_bin in range [1,30] and then
have the first map remove 11-21.

For #2 and #3 you could pick one of the conditions that you know to be the
more selective condition, use that as the MapReduce input and then use the
first MR phase to perform the other search.

But, as I mentioned in the first paragraph - Riak Search or Yokozuna seem
like a far more effective fit.


---
Jeremiah Peschka - Founder, Brent Ozar Unlimited
MCITP: SQL Server 2008, MVP
Cloudera Certified Developer for Apache Hadoop


On Sat, Aug 24, 2013 at 8:49 AM, Gints Gailītis <gints.gaili...@gmail.com>wrote:

> I guess it's bit hard to read the 3 samples I asked for, I'll spell them
> out like this:
> 1) index1_bin in range[1,10] OR in range [21:30]
> 2) index1_bin in range [1;50] AND index2_bin in range[5;10]
> 3) key in range[aaa,zzz] AND index1_bin in range[1,10] (where key is the
> actual key from the objects key-value)
>
> Thanks,
> Gints
>
>
>
> On Sat, Aug 24, 2013 at 6:35 PM, Gints Gailītis 
> <gints.gaili...@gmail.com>wrote:
>
>> Hi Riak users!
>>
>> I'm looking at the sample here:
>> http://docs.basho.com/riak/latest/dev/using/2i/ and wondering if there
>> is a way to use more complicated logic when using 2i input filters to limit
>> the input to a MapReduce function.
>>
>> For example, can I do stuff like "index1_bin in range[1,10] OR in range
>> [21:30]", or "index1_bin in range [1;50] AND index2_bin in range[5;10]" or
>> maybe even "key in range[aaa,zzz] AND index1_bin in range[1,10]" (where key
>> is the actual key from the objects key-value)]? And can I specify if the
>> start/end values should be included? If so, where can I read about this?
>>
>> Thanks,
>> Gints
>>
>>
>
> _______________________________________________
> 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

Reply via email to