Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Row pagination with HBase

Tags:

hbase

Is there a way to do pagination in HBase based on rowkeys?

I wanted to have the same effect as I do in SQL with SELECT * FROM table LIMIT 10 OFFSET 10.

If that's not possible, how should I best design my rowkeys to query appropriately?

like image 727
Jon Cardoso Avatar asked Jul 31 '13 21:07

Jon Cardoso


1 Answers

You can make use of PageFilter to do that. When you create the instance of PageFilter, you specify a pageSize parameter, which controls how many rows per page should be returned.

Filter filter = new PageFilter(10);

And if you wish to do it through the HBase shell you can use LIMIT with your SCAN query :

scan 'table', LIMIT => 10

like image 121
Tariq Avatar answered Oct 13 '22 11:10

Tariq