incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain RODRIGUEZ <arodr...@gmail.com>
Subject Re: CQL and undefined columns
Date Wed, 31 Jul 2013 12:21:52 GMT
I like to point to this article from Sylvain, which is really well written.

http://www.datastax.com/dev/blog/thrift-to-cql3

It explains a lot of things and is really interesting for Cassandra users
pre-CQL3.

Actually, old dynamic columns were defined this way :

CREATE TABLE test (
  key            text,
  column1     text,
  value          text,
  PRIMARY KEY (key, column1)
) WITH COMPACT STORAGE;

This is still doable with CQL3, column1 would be your column name, value,
the value of your column. As the primary key is composed by key + column1,
you can add as much columns as you want.

An other way to do it is to dynamically add columns (Alter table ...,
afaik, this is lock free and does not slow performance too much).


2013/7/31 Jon Ribbens <jon-cassandra@unequivocal.co.uk>

> I thought that part of the point of Cassandra was that, unlike a
> standard relational database, each row does not have to have the same
> set of columns. I don't understand how this squares with CQL. If I want
> to have a table ("column family"?) with a few fixed columns that are
> relevant to every row, I can create that with CQL's CREATE TABLE, but
> if I then want to set extra columns with arbitrary names on various
> rows, how do I tell CQL what type those columns are? Or is this
> feature of Cassandra now deprecated?
>

Mime
View raw message