Valid characters for data types and keyspace/table/column names
Keyspace, column, and table names created using CQL have restrictions regarding valid characters.
Keyspace, column, and table names created using CQL can only contain alphanumeric and underscore characters. User-defined data type names and field names, user-defined function names, and user-defined aggregate names created using CQL can only contain alphanumeric and underscore characters. If you enter names for these objects using anything other than alphanumeric characters or underscores, Apache Cassandra™ will issue an invalid syntax message and fail to create the object.
Creations that Work | Creations that Don't Work |
---|---|
CREATE TABLE foo ... | CREATE TABLE foo!$% ... |
CREATE TABLE foo_bar ... | CREATE TABLE foo[]"90 ... |
ALTER TABLE foo5 ... | ALTER TABLE foo5$$ |
CREATE FUNCTION foo5 ... | CREATE FUNCTION foo5$$ |
CREATE AGGREGATE foo5 ... | CREATE AGGREGATE foo5$$ |
CREATE TYPE foo5 (bar9 text, ... | CREATE TYPE foo5$$ (bar#9 int ... |