DROP TYPE
This page documents the preview version (v2.21). Preview includes features under active development and is for development and testing only. For production, use the stable version (v2024.1). To learn more, see Versioning.
Synopsis
Use the DROP TYPE statement to remove an existing user-defined data type.
Syntax
Diagram
Grammar
drop_type ::= DROP TYPE [ IF EXISTS ] type_name;
Where
type_nameis an identifier (possibly qualified with a keyspace name).
Semantics
- An error is raised if the specified
type_namedoes not exist unlessIF EXISTSoption is used. - A user-defined
type_namecannot be dropped if it is currently used in a table or another type.
Examples
ycqlsh:example> CREATE TYPE person(first_name TEXT, last_name TEXT, email TEXT);
ycqlsh:example> DROP TYPE person;