Data types

更新时间: 2026-08-20 10:53:38

This topic describes the data types supported by Fluss.

Data types

Data type

Description

BOOLEAN

A Boolean value that supports three-valued logic: TRUE, FALSE, or UNKNOWN.

TINYINT

A 1-byte signed integer with a range from -128 to 127.

SMALLINT

A 2-byte signed integer with a range from -32,768 to 32,767.

INT

A 4-byte signed integer with a range from -2,147,483,648 to 2,147,483,647.

BIGINT

An 8-byte signed integer with a range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.

FLOAT

A 4-byte single-precision floating-point number.

DOUBLE

An 8-byte double-precision floating-point number.

CHAR(n)

A fixed-length string where n is the number of characters. The value of n ranges from 1 to Integer.MAX_VALUE, inclusive.

STRING

A variable-length string.

DECIMAL(p, s)

A decimal number with fixed precision and scale. Here, p is the total number of digits (precision), and s is the number of digits after the decimal point (scale). The value of p ranges from 1 to 38, inclusive. The value of s ranges from 0 to p, inclusive.

DATE

A date in the format YYYY-MM-DD, with a range from 0000-01-01 to 9999-12-31. Unlike the SQL standard, the year starts from 0000.

TIME

A time without time zone information, by default without fractional seconds. The format is HH:MM:SS, with a range from 00:00:00 to 23:59:59. Unlike the SQL standard, leap seconds such as 23:59:60 and 23:59:61 are not supported. The semantics closely match java.time.LocalTime.

TIME(p)

A time without time zone information, where p is the number of fractional second digits (precision). The value of p ranges from 0 to 9, inclusive. The format is HH:MM:SS[.fractional_seconds], with a range from 00:00:00.000000000 to 23:59:59.999999999.

TIMESTAMP

A timestamp without time zone information, by default with 6 fractional second digits. The format is YYYY-MM-DD HH:MM:SS[.fractional_seconds], with a range from 0000-01-01 00:00:00.000000 to 9999-12-31 23:59:59.999999. Unlike the SQL standard, leap seconds are not supported. This type stores only the literal time value without any time zone information. Therefore, query results remain consistent across sessions in different time zones and do not change based on time zone settings.

TIMESTAMP(p)

A timestamp without time zone information, where p is the number of fractional second digits (precision). The value of p ranges from 0 to 9, inclusive. The format is YYYY-MM-DD HH:MM:SS[.fractional_seconds], with a range from 0000-01-01 00:00:00.000000000 to 9999-12-31 23:59:59.999999999. This type stores only the literal time value without any time zone information. Therefore, query results remain consistent across sessions in different time zones and do not change based on time zone settings.

TIMESTAMP_LTZ

A timestamp with local time zone, by default with 6 fractional second digits. The format is YYYY-MM-DD HH:MM:SS[.fractional_seconds] time_zone, with a range from 0000-01-01 00:00:00.000000 to 9999-12-31 23:59:59.999999. Unlike the SQL standard, leap seconds are not supported. This type stores the number of microseconds since 1970-01-01 00:00:00 UTC (a UTC timestamp). It does not record the original time zone ID but preserves the absolute point in time. When displayed or parsed, the system converts it to the corresponding local time based on the current session time zone. Therefore, query results may differ across sessions in different time zones.

TIMESTAMP_LTZ(p)

A timestamp with time zone, where p is the number of fractional second digits (precision). The value of p ranges from 0 to 9, inclusive. The format is YYYY-MM-DD HH:MM:SS[.fractional_seconds], with a range from 0000-01-01 00:00:00.000000000 to 9999-12-31 23:59:59.999999999. This type stores the number of milliseconds/microseconds/nanoseconds since 1970-01-01 00:00:00 UTC (a UTC timestamp). It does not record the original time zone ID but preserves the absolute point in time. When displayed or parsed, the system converts it to the corresponding local time based on the current session time zone. Therefore, query results may differ across sessions in different time zones.

BYTES

A variable-length binary string (that is, a sequence of bytes).

ARRAY<elementType>

An ordered collection of elements of the same subtype. Unlike the SQL standard, you cannot specify a maximum length. The maximum capacity is fixed at 2,147,483,647.

MAP<keyType,valueType >

A collection of key-value pairs that maps keys to values. Keys must be unique. This type extends the SQL standard.

ROW < [fieldName : fieldType [NOT NULL][COMMENT str][, …]] >

A sequence of structured fields, where each field has a name, a type, and an optional description. Example: ROW<name STRING, age INT>

上一篇: Table features 下一篇: Streaming Lakehouse
阿里云首页 实时计算 Flink版 相关技术圈