Skip to main content

Data Types

In most cases, you don't need to create streams manually or specify the data type for the columns. Timeplus source will automatically create the streams/columns with proper types when you load data from Kafka/CSV/etc.

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, 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 bytesto_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.
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''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
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