cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: How to obtain a row with column map
Date Sat, 19 Dec 2009 21:59:54 GMT
Use get_slice with a columnfamily parent, and you will get back a list
of supercolumns, including their subcolumns.

On Sat, Dec 19, 2009 at 3:45 PM, Jiri Jakes <jiri.jakes@gmail.com> wrote:
> Hello, all!
>
> As a newcomer, I am doing some experiments with Cassandra running on a
> single node. While I have been reading about Cassandra I thought that
> this task would be quite common but now I am trying to write some code
> as well.
>
> Assume this situation: I have a column family 'Comments', the key
> is an article identifier, super columns of TimeUUIDs, subcolumns like
> 'author', 'email', 'www', 'text' etc. Now I would like to obtain a
> single row, iterate through the super columns and for each super
> column extract the values of its subcolumns. The problem is that the
> Thrift interface returns only _lists_ of columns so I cannot do
> anything like:
>
> row = getRow("article-identifier");
> foreach(superColumn : row.getSuperColumns()) {
>  print(superColumn.getColumn("text").getValue());
> }
>
> How can I do this? Or is my approach just quite odd at all (let's say --
> too "relational")?
>
> Thank you.
>
> Jiri
>

Mime
View raw message