Skip to main content

Databend Data Types

Databend supports SQL data types in several categories:

General-Purpose Data Types

NameAliasesStorage SizeMin ValueMax ValueDescription
BOOLEANBOOL1 byteLogical boolean (true/false)
TINYINTINT81 byte-128127
SMALLINTINT162 bytes-3276832767
INTINT324 bytes-21474836482147483647
BIGINTINT648 bytes-92233720368547758089223372036854775807
FLOAT4 bytes-3.40282347e+383.40282347e+38
DOUBLE8 bytes-1.7976931348623157E+3081.7976931348623157E+308
DATE4 bytes1000-01-019999-12-31YYYY-MM-DD
TIMESTAMP8 bytes0001-01-01 00:00:009999-12-31 23:59:59.999999 UTCYYYY-MM-DD hh:mm:ss[.fraction], up to microseconds (6 digits) precision
VARCHARSTRINGvariable

Semi-structured Data Types

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

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