You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by vineet daniel <vi...@gmail.com> on 2010/04/29 11:40:22 UTC

can we have duplicate keys ?

Hi

Can anyone please tell me if we can have duplicate keys in Super Column
Family, if now how can we represent this : -

Article and Category Mapping

 clientOne.insert(:ArticleCategory, "12", {"ArticleID" => "123"})
                                                  "12", {"ArticleID" =>
"124"})
                                                   "12", {"ArticleID" =>
"125"})
                                                  "12", {"ArticleID" =>
"126"})

Here 12 is they key for a Category name 'sample' and all the four articles
are part of this key or sample. Is this right or I need to do something else
?

Re: can we have duplicate keys ?

Posted by Jonathan Ellis <jb...@gmail.com>.
use dynamic column names.

make a CF called Articles, have row key = 12, first column name 123,
next column name 124, etc.

On Thu, Apr 29, 2010 at 4:40 AM, vineet daniel <vi...@gmail.com> wrote:
> Hi
>
> Can anyone please tell me if we can have duplicate keys in Super Column
> Family, if now how can we represent this : -
>
> Article and Category Mapping
>
>  clientOne.insert(:ArticleCategory, "12", {"ArticleID" => "123"})
>                                                   "12", {"ArticleID" =>
> "124"})
>                                                    "12", {"ArticleID" =>
> "125"})
>                                                   "12", {"ArticleID" =>
> "126"})
>
> Here 12 is they key for a Category name 'sample' and all the four articles
> are part of this key or sample. Is this right or I need to do something else
> ?
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of Riptano, the source for professional Cassandra support
http://riptano.com