cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <aa...@thelastpickle.com>
Subject Re: Dynamic Column Families in CQLSH v3
Date Mon, 27 Aug 2012 22:56:35 GMT
It's not possible to have Dynamic Columns in CQL 3. The CF definition must specify the column
names you expect to store. 

The COMPACT STORAGE (http://www.datastax.com/docs/1.1/references/cql/CREATE_COLUMNFAMILY)
clause of the Create CF statement means can have column names that are part dynamic part static.
But if you want to have CF's where the app code controls the column names you need to create
the CF using the CLI and stick with the Thrift API. (because SELECT in CQL 3 does not support
arbitrary column slicing.)  

Background http://www.mail-archive.com/user@cassandra.apache.org/msg23636.html

Cheers

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

On 24/08/2012, at 2:24 PM, Erik Onnen <eonnen@gmail.com> wrote:

> Hello All,
> 
> Attempting to create what the Datastax 1.1 documentation calls a
> Dynamic Column Family
> (http://www.datastax.com/docs/1.1/ddl/column_family#dynamic-column-families)
> via CQLSH.
> 
> This works in v2 of the shell:
> 
> "create table data ( key varchar PRIMARY KEY) WITH comparator=LongType;"
> 
> When defined this way via v2 shell, I can successfully switch to v3
> shell and query the CF fine.
> 
> The same syntax in v3 yields:
> 
> "Bad Request: comparator is not a valid keyword argument for CREATE TABLE"
> 
> The 1.1 documentation indicates that comparator is a valid option for
> at least ALTER TABLE:
> 
> http://www.datastax.com/docs/1.1/configuration/storage_configuration#comparator
> 
> This leads me to believe that the correct way to create a dynamic
> column family is to create a table with no named columns and alter the
> table later but that also does not work:
> 
> "create table data (key varchar PRIMARY KEY);"
> 
> yields:
> 
> "Bad Request: No definition found that is not part of the PRIMARY KEY"
> 
> So, my question is, how do I create a Dynamic Column Family via the CQLSH v3?
> 
> Thanks!
> -erik


Mime
View raw message