Skip to Content
Developer GuideData Type

Data Types

For complete data types of ClickHouse, please refer to the official data types.

The following table lists only the commonly used ones.

Category Data Type Value/Range
Integer Types Int8 Range: -128 to 127.
Int16 Range: -32768 to 32767.
Int32 Range: -2147483648 to 2147483647.
Int64 Range: -9223372036854775808 to 9223372036854775807.
Floating Point Types Float32 A single precision floating-point number occupies 4 bytes in memory, described with 32-bit binary.
Float64 A double precision floating-point number occupies 8 bytes in memory, described with 64-bit binary.
Decimal Type Decimal A signed fixed-point number that maintains precision during addition, subtraction, and multiplication. Several notations are supported:
  • Decimal(P, S)
  • Decimal32(S)
  • Decimal64(S)
  • Decimal128(S)
String Types String Strings can be of any length. They can contain any byte set, including null bytes. Thus, the string type can replace types like VARCHAR, BLOB, CLOB in other DBMSs.
FixedString The FixedString type is efficient when the data length is exactly N bytes. In other cases, it may reduce efficiency. Examples of values that can be efficiently stored in columns with the FixedString type include:
  • Binary representation of IP addresses (IPv6 uses FixedString(16))
  • Language codes (ru_RU, en_US, …)
  • Currency codes (USD, RUB, …)
  • Binary representation of hash values (MD5 uses FixedString(16), SHA256 uses FixedString(32))
Date-Time Types Date Stored in two bytes, representing date values from 1970-01-01 (unsigned) to the present. No time zone information is stored in the date.
DateTime Stores Unix timestamps in four bytes (unsigned). Allows storing values in the same range as the date type. The minimum value is 0000-00-00 00:00:00. The timestamp type value is accurate to the second (without leap seconds). The time zone uses the system time zone when the client or server is started.
Datetime64 This type allows storing momentary time values in the form of date plus time.
Boolean Type Boolean ClickHouse does not have a separate type for storing boolean values. The UInt8 type can be used, with values restricted to 0 or 1.
Array Type Array Array(T), an array consisting of elements of type T. T can be any type, including array types. Multidimensional arrays are not recommended, as ClickHouse has limited support for them. For example, multidimensional arrays cannot be stored in MergeTree tables.
Tuple Type Tuple Tuple(T1, T2, ...), a tuple where each element has a separate type. Tuples cannot be stored in tables (except for memory tables). They can be used for temporary column grouping. In queries, IN expressions and lambda functions with specific parameters can be used for temporary column grouping.
Domain Data Types Domain Domain types are specific implementation types:

IPv4 is a Domain type binary-compatible with the UInt32 type, used for storing IPv4 address values. It provides more compact binary storage while supporting input and output formats that are more human-readable.

IPv6 is a Domain type binary-compatible with the FixedString(16) type, used for storing IPv6 address values. It provides more compact binary storage while supporting input and output formats that are more human-readable.

Enum Types Enum8 Range: -128 to 127.
Enum16 Range: -32768 to 32767.
Nullable Nullable Unless otherwise stated in the ClickHouse server configuration, NULL is the default value for any Nullable type. Nullable type fields cannot be included in table indexes.
Nested Type nested Nested data structures are like tables within cells. The specification of parameters (column names and types) for nested data structures is the same as in the CREATE TABLE query. Each table row can correspond to an arbitrary number of rows in the nested data structure.