Get a UDT
There are several ways to get information about user-defined types (UDTs) in a database:
-
Query the
system_schema.typestable to get a list of UDTs in a database, includingkeyspace_name,type_name,field_names, andfield_types. -
Use the CQL shell (
cqlsh)DESCRIBE TYPEcommand to get information about one UDT. -
Use the CQL shell (
cqlsh)DESCRIBE TYPEScommand to get information about all UDTs in the current keyspace.
The following example uses DESCRIBE TYPE to verify that a particular UDT exists and get the definition:
DESCRIBE TYPE cycling.fullname;
The result is the CREATE TYPE statement for the specified UDT.
You can use this output to re-create the UDT.
CREATE TYPE cycling.fullname (
firstname text,
lastname text
);
If you don’t have any keyspaces or UDTs, these commands return no information.