Expand description
Column type implementations for all ClickHouse data types.
§Column Module
This module provides implementations for all ClickHouse column types used in the native TCP protocol.
§ClickHouse Documentation
§Type Nesting Restrictions
ClickHouse enforces strict rules about type nesting. The following combinations are NOT allowed:
| Invalid Nesting | Error | Workaround |
|---|---|---|
Nullable(Array(...)) | “Nested type Array(…) cannot be inside Nullable type” (Error 43) | Use Array(Nullable(...)) |
Nullable(LowCardinality(...)) | “Nested type LowCardinality(…) cannot be inside Nullable type” | Use LowCardinality(Nullable(...)) |
Nullable(Array(LowCardinality(...))) | Same as above | Use Array(LowCardinality(Nullable(...))) or Array(Nullable(LowCardinality(...))) |
Correct Nesting Order:
- ✅
Array(Nullable(T))- Array of nullable elements - ✅
Array(LowCardinality(T))- Array of low-cardinality elements - ✅
Array(LowCardinality(Nullable(T)))- Array of nullable low-cardinality elements - ✅
LowCardinality(Nullable(T))- Low-cardinality column with nullable values
References:
- ClickHouse Issue #1062
- Arrays cannot be nullable
- ClickHouse Issue #42456
- LowCardinality cannot be inside Nullable
Re-exports§
pub use array::ColumnArray;pub use array::ColumnArrayT;pub use date::ColumnDate;pub use date::ColumnDate32;pub use date::ColumnDateTime;pub use date::ColumnDateTime64;pub use decimal::ColumnDecimal;pub use enum_column::ColumnEnum16;pub use enum_column::ColumnEnum8;pub use ipv4::ColumnIpv4;pub use ipv6::ColumnIpv6;pub use lowcardinality::ColumnLowCardinality;pub use map::ColumnMap;pub use nothing::ColumnNothing;pub use nullable::ColumnNullable;pub use string::ColumnFixedString;pub use string::ColumnString;pub use tuple::ColumnTuple;pub use uuid::ColumnUuid;pub use uuid::Uuid;pub use numeric::*;
Modules§
- array
- Array column type (
Array(T)). Array column implementation - column_
value - Column value extraction and insertion helpers. ColumnValue - A value extracted from or to be inserted into a column
- date
- Date and DateTime column types. Date and DateTime column implementations
- decimal
- Decimal column types (
Decimal32,Decimal64,Decimal128). - enum_
column - Enum8 and Enum16 column types. Enum8 and Enum16 column implementations.
- geo
- Geo type helpers (Point, Ring, Polygon, MultiPolygon). Geo type helpers for ClickHouse geo column types.
- ipv4
- IPv4 column type.
- ipv6
- IPv6 column type.
- lowcardinality
- LowCardinality column type (dictionary encoding). LowCardinality column implementation (dictionary encoding)
- map
- Map column type (
Map(K, V)). Map column implementation. - nothing
- Nothing/Void column type. Nothing/Void column implementation.
- nullable
- Nullable column type (
Nullable(T)). Nullable column implementation - numeric
- Numeric column types (integers, floats, bool). Numeric column implementations
- string
- String and FixedString column types. String column implementations
- tuple
- Tuple column type (
Tuple(T1, T2, ...)). Tuple column implementation. - uuid
- UUID column type. UUID column implementation.
Traits§
- Column
- Base trait for all column types Note: We use byte buffers instead of generic readers/writers to make the trait dyn-compatible
- Column
Iter - Trait for columns that support iteration over their values.
- Column
Typed - Helper trait for column types that can be downcasted
Type Aliases§
- Column
Ref - Reference to a column (using Arc for cheap cloning)