It's not currently supported in CQL 
https://issues.apache.org/jira/browse/CASSANDRA-3761

You can do it using the CLI, see the online help. 

Cheers


-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 2/03/2012, at 10:39 AM, Bayle Shanks wrote:

> hi, i'm wondering how to do composite data
> storage types in CQL. I am trying to mimic the Composite Types
> functionality of the Pycassa client:
> 
> http://pycassa.github.com/pycassa/assorted/composite_types.html
> 
> 
> In short, in Pycassa you can do something like:
> 
> ---
> 
> itemTimeCompositeType = CompositeType(UTF8Type(), LongType())
> 
> pycassa.system_manager.SystemManager().create_column_family(
>  keyspaceName,
>  columnFamilyName, 
>  key_validation_class=itemTimeCompositeType
> )
> 
> ...
> 
> columnFamily.insert(self._makeKey(item, time_as_integer), {field : value})
> 
> ---
> 
> 
> and then your primary key for this column family is a pair of a string
> and an integer. This is important because i am using
> ByteOrderedPartitioner and doing range scans among keys which share
> the same string 'item' but have different values for the integer.
> 
> My motivation is that i am trying to port
> https://github.com/bshanks/cassandra-timeseries-py to Ruby and i
> thought i might try CQL.
> 
> thanks,
>  bayle

Reply via email to