We have a column family which has a few defined columns, and the rest are set at runtime.
e.g.
create column family mytab WITH comparator = UTF8Type AND key_validation_class=UTF8Type
AND default_validation_class = UTF8Type
AND column_metadata = [
{column_name: full_name, validation_class: UTF8Type}
{column_name: email, validation_class: UTF8Type}
{column_name: state, validation_class: UTF8Type}
{column_name: gender, validation_class: UTF8Type}
{column_name: birth_year, validation_class: LongType}
];
set mytab['key1']['full_name']='Person 1';
set mytab['key1']['email']='person1@gmail.com';
set mytab['key1']['col1']='value1';
As you can see, the 3rd insert creates a new column 'col1' (which is not defined in the column_metadata).
Now doing list mytab from cassandra-cli, shows the extra column
[default@keyspace01] list mytab;
Using default limit of 100
-------------------
RowKey: key1
=> (column=col1, value=76616c756531, timestamp=1337108844540000)
=> (column=email, value=person1@gmail.com, timestamp=1337108716202000)
=> (column=full_name, value=Person 1, timestamp=1337108708791000)
Same goes for CQL 2.0
cqlsh:keyspace01> select * from mytab;
KEY,key1 | col1,76616c756531 | email,person1@gmail.com | full_name,Person 1
But I can't see 'col1' if using CQL 3.0
$./cqlsh -3 cass01
Connected to OG Cluster at cass01:9160.
[cqlsh 2.2.0 | Cassandra 1.1.0 | CQL spec 3.0.0 | Thrift protocol 19.30.0]
Use HELP for help.
cqlsh> use keyspace01;
cqlsh:keyspace01> select * from mytab;
key | birth_year | email | full_name | gender | state
------+------------+-------------------+-----------+--------+-------
key | null | null | null | null | null
key1 | null | person1@gmail.com | Person 1 | null | null
Is this the intended behavior in CQL 3.0. coz having this flexibility is very
important to us, which means we can't use CQL 3.0
