You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by AJ Chen <aj...@web2express.org> on 2010/04/05 01:03:56 UTC

how to paginate through CF

Pagination is be numbers, e.g. get 10 rows starting from number 100 or
getRows(100, 10). Column family uses KeyRange to get a section of the table.
This assumes the key is always sorted. Is it true? Secondly, the key
normally a string.  How do you translate the starting row number  to a
string key?  You can start from row 0 until row 100 and then collect 10
rows. This may not be efficient. Is there a better way to paginate through
CF?
thanks,
AJ

Re: how to paginate through CF

Posted by Vijay <vi...@gmail.com>.
>> This assumes the key is always sorted. Is it true?
yes, keys are always sorted within a column family,

>> How do you translate the starting row number  to a string key?
handled via client, you might need to store the last key which was returned
and start from there to fetch the next set.... First set starts with empty
stings ""

Hope this helps...

Regards,
</VJ>



On Sun, Apr 4, 2010 at 4:03 PM, AJ Chen <aj...@web2express.org> wrote:

> Pagination is be numbers, e.g. get 10 rows starting from number 100 or
> getRows(100, 10). Column family uses KeyRange to get a section of the table.
> This assumes the key is always sorted. Is it true? Secondly, the key
> normally a string.  How do you translate the starting row number  to a
> string key?  You can start from row 0 until row 100 and then collect 10
> rows. This may not be efficient. Is there a better way to paginate through
> CF?
> thanks,
> AJ
>
>