Data types
Lindorm Cassandra Query Language (CQL) is a typed language. This page covers all supported data types, their valid input formats, and key differences from standard Cassandra.
Supported data types
| Data type | Accepted constants | Description |
|---|---|---|
bigint | integer | 64-bit signed long integer |
blob | blob | Raw bytes up to 2 MB. The size limit is governed by the LindormTable quota. For details, see Quotas and limits. Important The |
boolean | boolean | true or false |
counter | integer | 64-bit signed counter column. Unlike standard Cassandra, Lindorm CQL counter tables can contain both counter columns and non-counter columns. See Counter for usage. |
date | integer, string | A calendar date. String format: yyyy-mm-dd |
decimal | integer, float | Variable-granularity decimal number |
double | integer, float | 64-bit IEEE 754 floating-point number |
float | integer, float | 32-bit IEEE 754 floating-point number |
inet | string | IPv4 or IPv6 address, stored as a string |
int | integer | 32-bit signed integer |
smallint | integer | 16-bit signed integer |
text | string | UTF-8 string |
time | integer, string | Time of day, measured in nanoseconds. String format: hh:mm:ss[.fffffffff] |
timestamp | integer, string | Point in time, measured in milliseconds. Accepts an integer (Unix epoch in ms) or a string. |
timeuuid | uuid | Version-1 UUID, commonly used as a conflict-free timestamp |
tinyint | integer | 8-bit unsigned integer |
uuid | uuid | UUID |
varint | integer | Variable-precision integer |
Counter
The counter type is for counter columns. Unlike standard Cassandra, Lindorm CQL counter tables can contain both counter columns and non-counter columns.
CREATE TABLE person_info (name text PRIMARY KEY, age counter, address text);
UPDATE person_info SET age = age + 2 WHERE name = 'my';
INSERT INTO person_info (name, age, address) VALUES ('my', 30, 'hz');Timestamp
The timestamp type stores a point in time, measured in milliseconds. Pass either an integer (Unix epoch in milliseconds) or a string.
All of the following values represent March 2, 2011 at 04:05:00 UTC:
1299038700000'2011-03-02 04:05+0000''2011-03-02 04:05:00+0000'
CREATE TABLE person_info (name text PRIMARY KEY, birthtime timestamp, address text);
INSERT INTO person_info (name, birthtime, address) VALUES ('my', 1299038700000, 'hz');
INSERT INTO person_info (name, birthtime, address) VALUES ('mm', '2011-03-02 04:05+0000', 'hz');
INSERT INTO person_info (name, birthtime, address) VALUES ('lucy', '2011-03-02 04:05:00+0000', 'bj');Time
The time type stores a time of day in nanoseconds. Pass an integer or a string in hh:mm:ss[.fffffffff] format. The fractional seconds part is optional.
CREATE TABLE person_info (name text PRIMARY KEY, birthtime time, address text);
INSERT INTO person_info (name, birthtime, address) VALUES ('lili', '08:12:54', 'hz');Date
The date type stores a calendar date. Pass an integer or a string in yyyy-mm-dd format.
CREATE TABLE person_info (name text PRIMARY KEY, birthday date, address text);
INSERT INTO person_info (name, birthday, address) VALUES ('lucy', '2021-02-01', 'beijing');Unsupported data types
The following types are not supported in Lindorm CQL:
Collection types:
SET,LIST, andMAPUser-defined types
duration