📅  最后修改于: 2020-11-22 09:02:32             🧑  作者: Mango
Cassandra支持不同类型的数据类型。让我们在下表中查看不同的数据类型:
CQL Type | Constants | Description |
---|---|---|
ascii | Strings | US-ascii character string |
bigint | Integers | 64-bit signed long |
blob | blobs | Arbitrary bytes in hexadecimal |
boolean | Booleans | True or False |
counter | Integers | Distributed counter values 64 bit |
decimal | Integers, Floats | Variable precision decimal |
double | Integers, Floats | 64-bit floating point |
float | Integers, Floats | 32-bit floating point |
frozen | Tuples, collections, user defined types | stores cassandra types |
inet | Strings | IP address in ipv4 or ipv6 format |
int | Integers | 32 bit signed integer |
list | Collection of elements | |
map | JSON style collection of elements | |
set | Collection of elements | |
text | strings | UTF-8 encoded strings |
timestamp | Integers, Strings | ID generated with date plus time |
timeuuid | uuids | Type 1 uuid |
tuple | A group of 2,3 fields | |
uuid | uuids | Standard uuid |
varchar | strings | UTF-8 encoded string |
varint | Integers | Arbitrary precision integer |
Cassandra提供了可以使数据自动过期的功能。
在数据插入期间,您必须以秒为单位指定“ ttl”值。 “ ttl”值是数据的生存时间值。经过特定时间后,数据将被自动删除。