I am trying to alter my cassandra tables starting with a specific name. My table starts with sample_1,sample_2,sample_13567,sample_adgf and so on... The table names are random but starting with same prefix.
I want to add a new column to all these tables. Can some one suggest me the update query using the regex for table names.
If you are using linux You can this in two step :
First Generate all alter command into a file like below :
The above command will create alter command to add
test textcolumn for tablesample_1tosample_13567and store into a filealter.cqlNow you can just load the cql file into cqlsh like below :
Here
By the way having too much table is not a good idea.
Check this link https://stackoverflow.com/a/33389204/2320144