Mapping Cassandra Super Columns
Posted
by
Laubstein
on Stack Overflow
See other posts from Stack Overflow
or by Laubstein
Published on 2011-01-13T23:02:50Z
Indexed on
2011/01/13
23:53 UTC
Read the original article
Hit count: 383
cassandra
|super-columns
Hello dudes, I guess everybody that played with Cassandra already read this article.
I trying to create my schema on CassandraCli, but I am having a lot of problems, can someone guide me to the right way? I am trying to create a similar structure like the Comments column family from the article.
In CassandraCli terminal I type:
create column family posts with column_type = ‘Super’ and comparator = ‘AsciiType’ and subcomparator = TimeUUIDType;
It works fine, there is no doc telling me that if I add a column_metadata attribute those will be for the super columns cause my column family is of type super, i can’t find if it is true so:
create column family posts with column_type = ‘Super’ and comparator = ‘AsciiType’ and subcomparator = ‘TimeUUIDType’ and column_metadata = [{column_name:'body'}];
I am trying to create the same as the comment column family of the article, but when i try to populate
set posts['post1'][timeuuid()][body] = ‘Hello I am Goku!’;
i got:
Invalid UUID string: body
I guess because i chose the subcomparator be of type timeuuid and the body is a string, it should be a timeuuid, so HOW my columns inside the super column which is the type timeuuid could holds columns with string type names as the comments of the article are created?
Thanks
© Stack Overflow or respective owner