Skip to main content

Databend Data Types

Databend supports SQL data types in several categories:

General-Purpose Data Types

Data TypeSyntaxSize(Bytes)Min ValueMax ValueDescription
BooleanBOOLEANLogical boolean (true/false)
Int8TINYINT1-128127
UInt8TINYINT UNSIGNED10255
Int16SMALLINT2-3276832767
UInt16SMALLINT UNSIGNED2065535
Int32INT4-21474836482147483647
UInt32INT UNSIGNED404294967295
Int64BIGINT8-92233720368547758089223372036854775807
UInt64BIGINT UNSIGNED8018446744073709551615
Float32FLOAT4-3.40282347e+383.40282347e+38
Float64DOUBLE8-1.7976931348623157E+3081.7976931348623157E+308
DateDATE21000-01-019999-12-31YYYY-MM-DD
DateTimeDATETIME41970-01-01 00:00:002105-12-31 23:59:59YYYY-MM-DD hh:mm:ss
DateTime64TIMESTAMP81677-09-21 00:12:44.0002262-04-11 23:47:16.854YYYY-MM-DD hh:mm:ss.ff
StringVARCHAR

Semi-structured Data Types

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

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