Data types

Updated at:

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 typeAccepted constantsDescription
bigintinteger64-bit signed long integer
blobblobRaw bytes up to 2 MB. The size limit is governed by the LindormTable quota. For details, see Quotas and limits.
Important

The blob type in Lindorm CQL differs from the blob type in Lindorm SQL in definition, limits, and usage. For the Lindorm SQL blob type, see BLOB data type (in invitational preview).

booleanbooleantrue or false
counterinteger64-bit signed counter column. Unlike standard Cassandra, Lindorm CQL counter tables can contain both counter columns and non-counter columns. See Counter for usage.
dateinteger, stringA calendar date. String format: yyyy-mm-dd
decimalinteger, floatVariable-granularity decimal number
doubleinteger, float64-bit IEEE 754 floating-point number
floatinteger, float32-bit IEEE 754 floating-point number
inetstringIPv4 or IPv6 address, stored as a string
intinteger32-bit signed integer
smallintinteger16-bit signed integer
textstringUTF-8 string
timeinteger, stringTime of day, measured in nanoseconds. String format: hh:mm:ss[.fffffffff]
timestampinteger, stringPoint in time, measured in milliseconds. Accepts an integer (Unix epoch in ms) or a string.
timeuuiduuidVersion-1 UUID, commonly used as a conflict-free timestamp
tinyintinteger8-bit unsigned integer
uuiduuidUUID
varintintegerVariable-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, and MAP

  • User-defined types

  • duration