ak87
ak87

Reputation: 161

How to alter cassandra table columns

I need to add additional columns to a table in cassandra. But the existing table is not empty. Is there any way to update it in a simple way? Otherwise what is the best approach to add additional columns to a non empty table? thx in advance.

Upvotes: 2

Views: 7642

Answers (1)

lorcan
lorcan

Reputation: 3300

There's a good example of adding table columns to an existing table in the CQL documentation on ALTER. The following statement will add the column gravesite (with type varchar) to to the table addamsFamily:

ALTER TABLE addamsFamily ADD gravesite varchar;

Upvotes: 6

Related Questions