incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin>
Subject Re: How to perform queries on Cassandra?
Date Sun, 11 Apr 2010 19:17:26 GMT
On Sun, Apr 11, 2010 at 12:10 PM, vineet daniel <> wrote:
> I assume that using the key i can get the all the columns like an array. Now
> i'd be using php to extract  arraykey=>value in that array, just want to
> avoid that i.e i can directly print the column names.

It doesn't work this way.  It's not an array, it's an ordered hash
sorted based on the compareWith setting for the CF.  For this reason,
you cannot do what you are suggesting and tell what is what.  Assuming
UTF8Type for comparisons, username 'vineet' and password 'foo'  in
your model is {'foo':'foo', 'vineet':'vineet'}, while username 'adam'
and password 'xylophone' is {'adam':'adam', 'xylophone':'xylophone'}.
Or is that username 'xylophone' with password 'adam'?  You could play
games with prepending strings to distinguish things, or you could just
use column names and indices properly and skip all this complexity.


View raw message