hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shuja Rehman <shujamug...@gmail.com>
Subject Re: Filter Rows on last 4 bytes
Date Fri, 29 Jul 2011 07:15:27 GMT
Yes, I have look that  But I did not find any comparator which takes
starting index and length to match. I was thinking to have such type of
comparator.

Filter rf = new RowFilter(CompareOp.EQUAL, new
BinaryComparator(Bytes.toBytes(ID), StartingIndex, Length);

And, about restriction, yes first four bytes will give me a subset which
further needs to filter on the basis of next 4 bytes.


On Wed, Jul 27, 2011 at 11:45 PM, Jean-Daniel Cryans <jdcryans@apache.org>wrote:

> You will need to use a RowFilter with a Comparator that only looks at
> the last 4 bytes,
>
> http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/filter/RowFilter.html
>
> FYI unless you are restricting your scans on a few rows, doing this on
> a whole table won't scale as it will do a full table scan.
>
> J-D
>
> On Wed, Jul 27, 2011 at 7:34 AM, Shuja Rehman <shujamughal@gmail.com>
> wrote:
> > Hi,
> >
> > I have the key consist of two integers (4+4=8 Bytes). and i want to
> filter
> > the rows on the basis of second integer which means need to compare last
> 4
> > bytes of key. If last 4 bytes matched with input integer then row should
> > include in the return results. Can you ppl let me know how to do this
> with
> > java API.
> >
> > Thanks
> >
> > --
> > Regards
> > Shuja-ur-Rehman Baig
> > <http://pk.linkedin.com/in/shujamughal>
> >
>



-- 
Regards
Shuja-ur-Rehman Baig
<http://pk.linkedin.com/in/shujamughal>

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