How to add multiple columns in cassandra table?

Pankaj Goyal picture Pankaj Goyal · Jan 5, 2016 · Viewed 8.3k times · Source

I need to add some new columns to my existing column_family/table in cassandra. I can add single column like this :

ALTER TABLE keyspace_name.table_name ADD column_name cql_type;

Can I add all new columns using a single query? If yes, how to do it using cql and datastax cassandra driver?

Answer

Lucas B picture Lucas B · Aug 2, 2016

This is fixed in Cassandra 3.6 https://issues.apache.org/jira/browse/CASSANDRA-10411

ALTER TABLE foo ADD (colname1 int, colname2 int)