I want to add columns dynamically to this column family via code using cql.
CREATE COLUMN FAMILY blog_entry
WITH comparator = UTF8Type
AND key_validation_class=UTF8Type
AND default_validation_class = UTF8Type;
how shall I do it?
This is becoming something of a FAQ, so I wrote an in-depth explanation: http://www.datastax.com/dev/blog/does-cql-support-dynamic-columns-wide-rows
For this to work you have to first alter the table to add column and then insert will start working. I tried the above on cqlsh and it worked.
alter table newdata add column name varchar;
Please refer below link too:
How to define dynamic column families in cassandra
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With