Overview
Numeric Types
The query engine supports the following numeric data types:
BOOLEAN
There are two possible values: 0 represents false, and 1 represents true.
For more info, please refer BOOLEAN.
Integer
All are signed integers. The differences among the INT types are the number of bytes occupied and the range of values they can represent:
-
TINYINT: 1 byte, [-128, 127]
-
SMALLINT: 2 bytes, [-32768, 32767]
-
INT: 4 bytes, [-2147483648, 2147483647]
-
BIGINT: 8 bytes, [-9223372036854775808, 9223372036854775807]
-
LARGEINT: 16 bytes, [-2^127, 2^127 - 1]
Floating-point
Including imprecise floating-point types FLOAT and DOUBLE, corresponding to the float and double in common programming languages
Fixed-point
The precise fixed-point type DECIMAL, used in financial and other cases that require strict accuracy.
Date Types
Date types include DATE, TIME, DATETIME and TIMESTAMPTZ. DATE type only stores the date accurate to the day, DATETIME type stores the date and time, which can be accurate to microseconds. TIME type only stores the time, and does not support the construction of the table storage for the time being, can only be used in the query process. TIMESTAMPTZ is a time zone-aware date-time type that stores values in UTC and automatically converts them based on the session time zone during queries.
Do calculation for datetime types or converting them to numeric types, please use functions like TIME_TO_SEC, DATE_DIFF, UNIX_TIMESTAMP . The result of directly converting them as numeric types as not guaranteed.
For more information refer to DATE, TIME, DATETIME and TIMESTAMPTZ documents.
String Types
The query engine supports both fixed-length and variable-length strings, including:
-
CHAR(M): A fixed-length string, where M is the byte length. The range for M is [1, 255].
-
VARCHAR(M): A variable-length string, where M is the maximum length. The range for M is [1, 65533].
-
STRING: A variable-length string with a compiled default soft limit of 10,485,760 bytes (10 MiB) in Core 26.1.3. The service manages
string_type_length_soft_limit_bytes, with an upper bound of 2,147,483,643 bytes. See the STRING reference for the support path and effective-setting limitations.
Binary Types
- VARBINARY: A variable-length binary byte sequence, where M is the maximum length (in bytes). Similar to VARCHAR, but represents byte sequences with no character set or collation involved; suitable for storing arbitrary binary data (e.g., file fragments, encrypted data, compressed data). It is available for expressions and supported external catalog mappings in Core 26.1.3. Native-table column storage and binary comparisons are not supported. External mappings depend on connector settings. See the VARBINARY reference.
Semi-Structured Types
The query engine supports different semi-structured data types for JSON data processing, each tailored to different use cases.
-
ARRAY / MAP / STRUCT: They support nested data and fixed schema, making them well-suited for analytical workloads such as user behavior and profile analysis, as well as querying data lake formats like Parquet. Due to the fixed schema, there is no overhead for dynamic schema inference, resulting in high write and analysis performance.
-
VARIANT: It supports nested data and flexible schema. It is well-suited for analytical workloads such as log, trace, and IoT data analysis. It can accommodate any legal JSON data, which will be automatically expanded into sub-columns in a columnar storage format. This approach enables high compression rate in storage and high performance in data aggregation, filtering, and sorting.
-
JSON: It supports nested data and flexible schema. It is optimized for high-concurrency point query use cases. The flexible schema allows for ingesting any legal JSON data, which will be stored in a binary format. Binary encoding avoids reparsing the original JSON text for each extraction. Query performance depends on the workload.
Aggregation Types
The aggregation data types store aggregation results or intermediate results during aggregation. They are used for accelerating aggregation-heavy queries.
-
BITMAP: It is used for exact deduplication, such as in (UV) statistics and audience segmentation. It works in conjunction with BITMAP functions like
bitmap_union,bitmap_union_count,bitmap_hash, andbitmap_hash64. -
HLL: It is used for approximate deduplication with accuracy and performance that depend on cardinality and the workload. It works in conjunction with HLL functions like
hll_union_agg,hll_raw_agg,hll_cardinality, andhll_hash. -
QUANTILE_STATE: It is used for approximate percentile calculations using a compact intermediate representation. It works with functions like
QUANTILE_PERCENT,QUANTILE_UNION, andTO_QUANTILE_STATE. -
AGG_STATE: It is used to accelerate aggregations, utilized in combination with aggregation function combinators like state/merge/union.
IP Types
IP data types store IP addresses in a binary format, which is faster and more space-efficient for querying compared to storing them as strings. There are two supported IP data types: