What is the command to update a column family and alter its gc_grace_seconds
value using cassandra-cli
?
Using ALTER command, you can add a column to a table. While adding columns, you have to take care that the column name is not conflicting with the existing column names and that the table is not defined with compact storage option. Given below is the syntax to add a column to a table.
Syntax: ALTER (TABLE | COLUMNFAMILY) <tablename> <instruction>
'gc_grace_seconds' is the time (in seconds, defined in Table properties) cassandra keep Tombstone so that other nodes which might be down during deletion of data can know the changes.
To remove a column from the table, use the DROP instruction: ALTER TABLE cycling. basic_info DROP birth_year; DROP removes the column from the table definition and marks the column values with tombstones.
On cassandra-cli
is without "seconds"
UPDATE COLUMN FAMILY cf with GC_GRACE = 86400; //one day
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