cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: composite types in CQL
Date Mon, 05 Mar 2012 09:46:44 GMT
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


Mime
View raw message