cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <>
Subject Re: cassandra-cli: Create column family with composite column name
Date Wed, 05 Oct 2011 20:35:33 GMT
Hi Jim, 

The best resource I know so far is

I just started working on a blog post about them last night, and I hope to update the wiki
with some information when I am done. Feel free to mail me directly if you want to collaborate.

I'm none the wiser on the ":" issue, one of the things I was hoping to learn about. 


Aaron Morton
Freelance Cassandra Developer

On 6/10/2011, at 9:08 AM, Jim Ancona wrote:

> Using Cassandra 0.8.6, I've been trying to figure out how to use the
> CLI to create column families using composite keys and column names.
> The documentation on CompositeType seems pretty skimpy. But in the
> course of writing this email to ask how to do it, I figured out the
> proper syntax. In the hope of making it easier for the next person, I
> repurposed this message to document what I figured out. I'll also
> update the wiki. Here is the syntax:
> create column family MyCF
>    with key_validation_class = 'CompositeType(UTF8Type, IntegerType)'
>    and comparator = 'CompositeType(DateType(reversed=true), UTF8Type)'
>    and default_validation_class='CompositeType(UTF8Type, DateType)'
>    and column_metadata=[
>        { column_name:'0:my Column Name', validation_class:LongType,
> index_type:KEYS}
>    ];
> One weakness of this syntax is that there doesn't seem to be a way to
> escape a ':' in a composite value. There's a FIXME in the code to that
> effect.
> Jim

View raw message