hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pavan Sudheendra <pavan0...@gmail.com>
Subject Re: Pagination with HBase
Date Thu, 01 Aug 2013 17:10:21 GMT
Use http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Scan.html#getStartRow()
and http://hbase.apache.org/apidocs/org/apache/hadoop/hbase/client/Scan.html#getStopRow()


i=1; //start row
j=100; //end row
while(i<someval) {
    Scan scan = new Scan(Bytes.ToBytes(i),Bytes.toBytes(j)); // i
denotes start row and j denotes end row
    //probably convert i & j to string to keep it human-readable

    scan.addColumn(ColumnFamily, ColumnQualifier);

    // do something

    i = i+100;
    j = j +100;
}

On Thu, Aug 1, 2013 at 10:31 PM, Jonathan Cardoso
<jonathancardos@gmail.com> wrote:
> Hi!
>
> Is there a way to scan a HBase table getting, for example, the first 100
> results, then later get the next 100 and so on... Just like in SQL we do
> with LIMIT and OFFSET?
>
>
> *Jonathan Cardoso** **
> Universidade Federal de Goias*



-- 
Regards-
Pavan

Mime
View raw message