Home » Cassandra CQL Data Types

Cassandra CQL Data Types


Cassandra Data Types

Cassandra supports different types of data types. Let?s see the different data types in the following table:

CQL TypeConstantsDescription
asciiStringsUS-ascii character string
bigintIntegers64-bit signed long
blobblobsArbitrary bytes in hexadecimal
booleanBooleansTrue or False
counterIntegersDistributed counter values 64 bit
decimalIntegers, FloatsVariable precision decimal
doubleIntegers, Floats64-bit floating point
floatIntegers, Floats32-bit floating point
frozenTuples, collections, user defined typesstores cassandra types
inetStringsIP address in ipv4 or ipv6 format
intIntegers32 bit signed integer
listCollection of elements
mapJSON style collection of elements
setCollection of elements
textstringsUTF-8 encoded strings
timestampIntegers, StringsID generated with date plus time
timeuuiduuidsType 1 uuid
tupleA group of 2,3 fields
uuiduuidsStandard uuid
varcharstringsUTF-8 encoded string
varintIntegersArbitrary precision integer

Cassandra Automatic Data Expiration

Cassandra provides functionality by which data can be automatically expired.

During data insertion, you have to specify ‘ttl’ value in seconds. ‘ttl’ value is the time to live value for the data. After that particular amount of time, data will be automatically removed.

You may also like