Drop a UDT
If you no longer need a UDT, you can use the DROP TYPE
command to delete the UDT specification from the keyspace.
All metadata associated with the UDT is also deleted.
The following example drops a UDT named race
in the keyspace cycling
:
DROP TABLE IF EXISTS cycling.cyclist_races;
If any tables use the UDT, you must drop those UDT columns before you can drop the UDT from the keyspace. All data stored as the UDT must be deleted because the type will no longer exist to define columns.
If you need to retain the data from UDT columns, take action to preserve the data before dropping the UDT column. For example, you could rewrite the data to one or more new columns, or you could extract the data and store it externally for data