Data types
Built-in data types for columns.
CQL defines built-in data types for columns. The counter type is unique.
CQL Type | Constants | Description |
---|---|---|
ascii | strings | US-ASCII character string |
bigint | integers | 64-bit signed long |
blob | blobs | Arbitrary bytes (no validation), expressed as hexadecimal |
boolean | booleans | true or false |
counter | integers | Distributed counter value (64-bit long) |
decimal | integers, floats | Variable-precision decimal |
double | integers | 64-bit IEEE-754 floating point |
float | integers, floats | 32-bit IEEE-754 floating point |
inet | strings | IP address string in IPv4 or IPv6 format* |
int | integers | 32-bit signed integer |
list | n/a | A collection of one or more ordered elements |
map | n/a | A JSON-style array of literals: { literal : literal, literal : literal ... } |
set | n/a | A collection of one or more elements |
text | strings | UTF-8 encoded string |
timestamp | integers, strings | Date plus time, encoded as 8 bytes since epoch |
uuid | uuids | A UUID in standard UUID format |
timeuuid | uuids | Type 1 UUID only (CQL 3) |
varchar | strings | UTF-8 encoded string |
varint | integers | Arbitrary-precision integer |
*Used by python-cql driver and binary protocols.
In addition to the CQL types listed in this table, you can use a string containing the name of a JAVA class (a sub-class of AbstractType loadable by Cassandra) as a CQL type. The class name should either be fully qualified or relative to the org.apache.cassandra.db.marshal package.
Enclose ASCII text, timestamp, and inet values in single quotation marks. Enclose names of a keyspace, table, or column in double quotation marks.