incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Partogi <joshua.j...@gmail.com>
Subject Re: Is it possible to get list of row keys?
Date Thu, 24 Feb 2011 01:24:37 GMT
Hi everyone,

Thank you to everyone that have responded to my email. I really
appreciate that. I am sorry for not making it clear in my original
post that what I am looking for is the list of keys in the database
assuming that the client application does not know the keys. From what
I understand, RangeSliceQuery requires you to pass the startKey, which
means the client application have to know beforehand the key that will
be used as startkey.

So, I am trying to do this in cassandra:

select id from table_name;

while RangeSliceQuery would be something like this in SQL (CMIIW),
which is not what I want:

select id from table_name where id between 100 and 1000;

Please let me know whether what I am after is achievable in cassandra.

Kind regards,
Joshua.

On Thu, Feb 24, 2011 at 12:47 AM, Ching-Cheng Chen
<cchen@evidentsoftware.com> wrote:
> Actually, if you want to get ALL keys, I believe you can still use
> RangeSliceQuery with RP.
> Just use setKeys("","") as first batch call.
> Then use the last key from previous batch as startKey for next batch.
> Beware that since startKey is inclusive, so you'd need to ignore first key
> from now on.
> Keep going until you finish all batches.  You will know you'd need to stop
> when setKeys(key_xyz,"") return you only one key.
> This should get you all keys even with RP.
> Regards,
> Chen
> www.evidentsoftware.com
>
> On Wed, Feb 23, 2011 at 8:23 AM, Norman Maurer <norman@apache.org> wrote:
>>
>> query per ranges is only possible with OPP or BPP.
>>
>> Bye,
>> Norman
>>
>>
>> 2011/2/23 Sasha Dolgy <sdolgy@gmail.com>:
>> > What if i want 20 rows and the next 20 rows in a subsequent query?  can
>> > this
>> > only be achieved with OPP?
>> >
>> > --
>> > Sasha Dolgy
>> > sasha.dolgy@gmail.com
>> >
>> > On 23 Feb 2011 13:54, "Ching-Cheng Chen" <cchen@evidentsoftware.com>
>> > wrote:
>> >
>
>



-- 
http://twitter.com/jpartogi

Mime
View raw message