Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename keyspace in Cassandra?

Tags:

cassandra

How do you rename a live Cassandra keyspace through the cassandra-cli? Previous versions had an option in cassandra-cli ("rename keyspace"). However, that option has been dropped in recent releases.

like image 591
Irfan Avatar asked Oct 04 '11 14:10

Irfan


People also ask

Can you rename a keyspace Cassandra?

Keyspace Name: Keyspace name cannot be altered in Cassandra. Strategy Name: Strategy name can be altered by using a new strategy name. Replication Factor: Replication factor can be altered by using a new replication factor.

How do I change the keyspace replication factor in Cassandra?

If you want to change the replication factor of a keyspace, you can do it by executing the ALTER KEYSPACE command, which has the following syntax: Syntax: ALTER KEYSPACE "KeySpace Name" WITH replication = {'class': 'Strategy name', 'replication_factor' : 'No. Of replicas'};

Can you change table name Cassandra?

The main purpose of RENAME is to change the names of CQL-generated primary key and column names that are missing from a legacy table. The following restrictions apply to the RENAME operation: You can only rename clustering columns, which are part of the primary key. You cannot rename the partition key.


1 Answers

Renaming keyspaces (and column families) is no longer supported, since it was prone to race conditions. See https://issues.apache.org/jira/browse/CASSANDRA-1585.

like image 133
Theodore Hong Avatar answered Sep 19 '22 05:09

Theodore Hong