On Thu, Feb 11, 2010 at 7:41 PM, Stack <[email protected]> wrote: > On Wed, Feb 10, 2010 at 7:16 AM, Bruno Dumon <[email protected]> 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. > >> 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. -- Bruno Dumon Outerthought http://outerthought.org/
