hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stack <st...@duboce.net>
Subject Re: filtering on a prefix of the row key
Date Fri, 12 Feb 2010 20:11:06 GMT
On Fri, Feb 12, 2010 at 2:17 AM, Bruno Dumon <bruno@outerthought.org> wrote:
> On Thu, Feb 11, 2010 at 7:41 PM, Stack <stack@duboce.net> wrote:
>> On Wed, Feb 10, 2010 at 7:16 AM, Bruno Dumon <bruno@outerthought.org> wrote:
>>> Hi,
>>>
>>> I would like a filter that accepts rows as long as the first X bytes
>>> of the row key are less than or equal to a certain byte array.
>>>
>>
>> Would an inclusivestoprow filter work for you where the stoprow is the
>> 'certain byte array'?
>
> No, since once the stoprow becomes a prefix of the row key, the
> 'greater than' test fails and the filter will exclude the row.
>
Ok.  Makes sense.

>>
>>> I have created a BinaryPrefixComparator. It is similar to the
>>> BinaryComparator, but it only compares the part of the row key up to
>>> the same length as the supplied byte array. It fits my needs exactly.
>>>
>>> Can I submit a patch with this comparator, or is there another way to
>>> obtain the same behavior?
>>>
>>
>> Patch welcome.  Please file a JIRA.
>
> Done: HBASE-2211. I explained my use case there too.
>
>>  You had to add your filter to HbaseObjectWritable?
>
> Nope, it is only a Comparator that can be used in combination with
> existing CompareFilters.

Thanks for the patch.
St.Ack

Mime
View raw message