Cassandra Practice Test

Question: 1 / 400

Which of the following is a key restriction when altering a table in Cassandra?

The primary key cannot be changed

In Cassandra, a fundamental restriction when altering a table is that the primary key cannot be changed once it has been defined. The primary key in Cassandra serves as a unique identifier for the rows in a table and is crucial for the distribution of data across nodes. Changing the primary key would not only redefine the unique structure of the table but would also affect data distribution, replication, and potential access patterns. Therefore, maintaining the integrity of the primary key throughout a table's lifecycle is paramount, which is why this statement holds true.

The other options highlight misconceptions about table alterations in Cassandra. For instance, columns can be dropped, provided they are not part of the primary key. While datatypes of columns can typically be altered, this is limited to some specific changes and does not encompass all scenarios. Lastly, although recreating a table is sometimes necessary for significant structural changes, it is not a blanket requirement for every modification made to a Cassandra table, especially when it comes to adding or altering non-primary key columns. Thus, the insistence on the immutability of the primary key during alterations underscores the correct answer.

Get further explanation with Examzify DeepDiveBeta

You cannot drop columns

Only datatypes can be changed

You must recreate the table to make any change

Next Question

Report this question

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy