Assigning a user-defined type to a column

Since the education_information type is designed to play the same role as the tuple used in our existing education column, let's drop the tuple column and replace it with the more semantic user-defined type:

ALTER TABLE "users" DROP "education"; 

This query will initially fail with the following error:

Since the column "education" has a secondary index on it, we would have to delete the index in order to delete the column itself:

  DROP INDEX "users_education_idx";

After deleting the secondary index, try deleting the column again:

ALTER TABLE "users" ADD "education" frozen <"education_information">; ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.