I am very new to Cassandra, and using the cqlsh to try out basic queries. I want to alter a table by inserting a new column with a default value (say 0). This is same as this SO question, the difference being I am trying to do it from cqlsh, so can't run an insert command on 50,000 rows. Is there a "cqlish" way to achieve this?
There are no cqlsh/cql driver ways to this at the moment without executing on all of your rows. The simplest way may be to use a Spark and the Cassandra Connector.
There you could do something like
case class RowObj( oldValue1: Type, ..., newDefaultValue: Type)
sc.cassandraTable[RowObj]("keyspace","table")
.map(row -> row.copy(newDefaultValue = default)
.saveToCassandra("keyspace","table")