hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew LeMieux <...@mlogiciels.com>
Subject Re: scan specific hbase region
Date Wed, 20 Oct 2010 13:56:05 GMT
Yes, what are you using to do the scan?

* In the "hbase shell", you can do this: "hbase> scan 't1', {COLUMNS => ['c1', 'c2'],
LIMIT => 10, STARTROW => 'xyz'}"  (Note the STARTROW argument) (taken directly from
the help inside the tool)

* When scanning from java client, you can pass a Scan object to [HTable object].getScanner(scan),
the scan object has .setStartRow and .setStopRow methods.  (http://hbase.apache.org/docs/current/api/org/apache/hadoop/hbase/client/Scan.html
and http://hbase.apache.org/docs/current/api/org/apache/hadoop/hbase/client/HTable.html )
 Set the stop row and the start row before calling getScanner, and you will only iterate over
the range of keys you specified.  

-Matthew

On Oct 20, 2010, at 3:24 AM, Oleg Ruchovets wrote:

> Hi ,
> 
>    I am running hbase scan on daily basis.
> HBase table become bigger and as a result it takes to more time to scan it ,
> but actually I don't need to scan all the table. Most of the time I need to
> scan partial data of it.
> The question is: is it possible to scan specific region/regions of  hbase
> table or in case I know start/end key of needed region, using it to scan
> partial data and not all table?
> Please post me link or example how to do it (google was not so helpfull).
> 
> Thanks Oleg.


Mime
View raw message