Create a table in Cassandra 1.2 with CQL3 where column names will be created at runtime
I want to store snapshots of an object in Apache Cassandra 1.2 Row key is the Object#ID and there will be a column for each snapshot. -------- latest -------- v2 -------- v1 id-122 100 -------- 50 -------- 66 -------- So column names are created dynamically at runtime. How to create the previous table in Cassandra 1.2 using CQL3 ? You would use the compound primary key feature of CQL3: CREATE TABLE foo ( object_id int, version int, value int, PRIMARY KEY (object_id, version)); In CQL3, Table schema is fixed. So you can't really get dynamic column names. For that you have to switch to CQL2. 来源: