Skip to main content

Databend Data Types

Databend supports SQL data types in several categories:

General-Purpose Data Types

NameStorage SizeMin ValueMax ValueDescription
BOOLEAN1 byteLogical boolean (true/false)
TINYINT1 byte-128127
SMALLINT2 bytes-3276832767
INT4 bytes-21474836482147483647
BIGINT8 bytes-92233720368547758089223372036854775807
FLOAT4 bytes-3.40282347e+383.40282347e+38
DOUBLE8 bytes-1.7976931348623157E+3081.7976931348623157E+308
DATE2 bytes1000-01-019999-12-31YYYY-MM-DD
DATETIME4 bytes1970-01-01 00:00:002105-12-31 23:59:59YYYY-MM-DD hh:mm:ss
TIMESTAMP8 bytes1677-09-21 00:12:44.0002262-04-11 23:47:16.854YYYY-MM-DD hh:mm:ss.ff
VARCHARvariable

Semi-structured Data Types

Databend supports three Semi-structured types: ARRAY, OBJECT and VARIANT.

NameBuild From ValuesDescription
ARRAY[1,2,3]Zero-based indexed list, each value can have difference data type.
OBJECT{"a":1,"b":{"c":2}}Collection of key-value pairs, each key is a VARCHAR, and each value is a VARIANT.
VARIANT[1,{"a":1,"b":{"c":2}}]Collection of elements of different data types., including ARRAY and OBJECT.