Skip to main content

Data Types

Like many analytics systems, the following common types are supported.

CategoryTypeExampleNoteRelated functions
Numeric Typesinteger-100default with 4 bytes. Same as int32. You can also use int, int8, int16, int32, int64, smallint, bigint, or uint16 etc.to_int
decimal3.14decimal(precision, scale). Valid range for precision is [1: 76], valid range for scale is [0: precision]to_decimal
float-3.1415default with 4 bytes. Same as float32. You can also use float64 or double for 8 bytes. No float8 or float16.to_float
Boolean Typebooltruetrue or false
String Typestring'Hello'strings of an arbitrary length. You can also use varchar To create string columns with fixed size in bytes, use fixed_string(positiveInt)to_string, etc.
JSON Typejson'{"a":1,"b":["x","y"]}'New in Timeplus Enterprise 2.9. The JSON document is stored in a more optimized, columnar-like layout to improve query performance.
Universally Unique Identifieruuid1f71acbf-59fc-427d-a634-1679b48029a9a universally unique identifier (UUID) is a 16-byte number used to identify records. For detailed information about the UUID, see Wikipediauuid
IP addressipv4'116.253.40.133'IPv4 addresses. Stored in 4 bytes as uint32.to_ipv4
ipv6'2a02:aa08:e000:3100::2'IPv6 addresses. Stored in 16 bytes as uint128.to_ipv6
Enumerated Typesenum, enum8, enum16enum('hello' = 1, 'world' = 2)Enumerated types are a special data type that allows you to store string values as numbers to improve storage efficiency
Date and Time Typesdate'2022-05-16'without timeto_date, today
datetime'2022-05-16 11:01:02'with secondto_time, now
datetime64'2022-05-16 11:01:02.345'with millisecond, same as datetime64(3)to_time, now64
Compound Typesarray[1,2]access 1st element via array[1]length, array_concat
mapmap_cast('k1','v1','k2','v2')access key1 via map['key1']map_cast
tuple(1,2)access 1st element via tuple.1tuple_cast