hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Yu <yuzhih...@gmail.com>
Subject Re: Is FuzzyRowFilter also a PrefixFilter
Date Thu, 06 Mar 2014 15:02:21 GMT
Take a look at this method of FuzzyRowFilter:

  private static SatisfiesCode satisfies(byte[] row, int offset, int length,

                                         byte[] fuzzyKeyBytes, byte[]
fuzzyKeyMeta) {

The for loop is controlled by fuzzyKeyMeta.length

Meaning it compares as many bytes as you give in the fuzzy info byte array.


Cheers


On Thu, Mar 6, 2014 at 5:09 AM, Amit Sela <amits@infolinks.com> wrote:

> Hi all,
>
> I have the following row structure:
>
> yyyyMMdd_Country_CategoryId1_CategoryId2_CategoryId3
>
> Any field, except for the date may be empty (each day there is one row that
> looks like this: yyyyMMdd____)
>
> I use FuzzyRowFilter like this:
>
> Filter filter = new FuzzyRowFilter(
>                 Arrays.asList(
>                         new Pair<>(
>
> Bytes.toBytesBinary("\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00____"),
>                                 new byte[] {1,1,1,1,1,1,1,1,0,0,0,0})));
> In addition to getting back all rows of type:
> yyyyMMdd____
> I also get rows of type:
> yyyyMMdd____13 - where 13 is of type CategoryId3
>
> It looks like FuzzyRowFilter acts as RowPrefixFilter as well...
>
> Is it supposed to be like that ?  am I using it wrong ?
>
> Thanks,
> Amit.
>
> (Using HBase 0.94.12 with Hadoop 1.0.4)
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message