You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Piotr Praczyk <pi...@gmail.com> on 2009/06/15 18:45:12 UTC

Searching for the rows

Hi

Does anybody maybe know, if there exists a method of finding the first row
larger (and smaller) in the lexycographical order than given ( not
necessarily existing) row id ?
In particular I would like to find the first and the last row having a given
prefix as a row id.

I would be very grateful for any help :-)


regards
Piotr

Re: Searching for the rows

Posted by Piotr Praczyk <pi...@gmail.com>.
Thank you :-)

Am I right, or using those filters have the drawback of applying them to all
the rows following a necessary one instead of stopping the entire process ?
If I have some small number of rows with given prefix, near the beginning of
a region, will the filters make the MR task scan through all the remaining
records and execute the filter methods over their data ? [If so, I should
probably use it combined with a final row set to the following prefix ?,
which would make the MR process iterate over at most one incorrect row .. ]
(Just to be clear - I want to pack this data into TableSplit object)

cheers
Piotr

2009/6/15 stack <st...@duboce.net>

> On Mon, Jun 15, 2009 at 9:45 AM, Piotr Praczyk <piotr.praczyk@gmail.com
> >wrote:
>
> >
> > Does anybody maybe know, if there exists a method of finding the first
> row
> > larger (and smaller) in the lexycographical order than given ( not
> > necessarily existing) row id ?
>
>
>
> If you open a scanner with a first row, hbase will find the first row that
> matches or the next one after the provided first row.
>
> To stay within a range that all adheres to a particular prefix, see the
>
> http://hadoop.apache.org/hbase/docs/r0.19.3/api/org/apache/hadoop/hbase/filter/PrefixRowFilter.html
> .
> Don't forget to wrap it in a
>
> http://hadoop.apache.org/hbase/docs/r0.19.3/api/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.html
> .
> See the 'description' on this page,
>
> http://hadoop.apache.org/hbase/docs/r0.19.3/api/org/apache/hadoop/hbase/filter/package-summary.html#package_description
> ,
> for why WhileMatchRowFilter is needed.
>
> St.Ack
>

Re: Searching for the rows

Posted by stack <st...@duboce.net>.
On Mon, Jun 15, 2009 at 9:45 AM, Piotr Praczyk <pi...@gmail.com>wrote:

>
> Does anybody maybe know, if there exists a method of finding the first row
> larger (and smaller) in the lexycographical order than given ( not
> necessarily existing) row id ?



If you open a scanner with a first row, hbase will find the first row that
matches or the next one after the provided first row.

To stay within a range that all adheres to a particular prefix, see the
http://hadoop.apache.org/hbase/docs/r0.19.3/api/org/apache/hadoop/hbase/filter/PrefixRowFilter.html.
Don't forget to wrap it in a
http://hadoop.apache.org/hbase/docs/r0.19.3/api/org/apache/hadoop/hbase/filter/WhileMatchRowFilter.html.
See the 'description' on this page,
http://hadoop.apache.org/hbase/docs/r0.19.3/api/org/apache/hadoop/hbase/filter/package-summary.html#package_description,
for why WhileMatchRowFilter is needed.

St.Ack