#[non_exhaustive]pub enum DataTypeNode {
Show 47 variants
Bool,
UInt8,
UInt16,
UInt32,
UInt64,
UInt128,
UInt256,
Int8,
Int16,
Int32,
Int64,
Int128,
Int256,
Float32,
Float64,
BFloat16,
Decimal(u8, u8, DecimalType),
String,
FixedString(usize),
UUID,
Date,
Date32,
DateTime(Option<String>),
DateTime64(DateTimePrecision, Option<String>),
Time,
Time64(DateTimePrecision),
Interval(IntervalType),
IPv4,
IPv6,
Nullable(Box<DataTypeNode>),
LowCardinality(Box<DataTypeNode>),
Array(Box<DataTypeNode>),
Tuple(Vec<DataTypeNode>),
Enum(EnumType, HashMap<i16, String>),
Map([Box<DataTypeNode>; 2]),
AggregateFunction(String, Vec<DataTypeNode>),
SimpleAggregateFunction(String, Box<DataTypeNode>),
Variant(Vec<DataTypeNode>),
Dynamic,
JSON,
JsonWithHint(Vec<(String, Box<DataTypeNode>)>),
Point,
Ring,
LineString,
MultiLineString,
Polygon,
MultiPolygon,
}Expand description
Represents a data type in ClickHouse. See https://clickhouse.com/docs/sql-reference/data-types
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Bool
UInt8
UInt16
UInt32
UInt64
UInt128
UInt256
Int8
Int16
Int32
Int64
Int128
Int256
Float32
Float64
BFloat16
Decimal(u8, u8, DecimalType)
Scale, Precision, 32 | 64 | 128 | 256
String
FixedString(usize)
UUID
Date
Date32
DateTime(Option<String>)
Optional timezone
DateTime64(DateTimePrecision, Option<String>)
Precision and optional timezone
Time
Time-of-day, no timezone (timezone is ignored in value operations)
Time64(DateTimePrecision)
Precision and optional timezone (timezone is ignored in value operations)
Interval(IntervalType)
IPv4
IPv6
Nullable(Box<DataTypeNode>)
LowCardinality(Box<DataTypeNode>)
Array(Box<DataTypeNode>)
Tuple(Vec<DataTypeNode>)
Enum(EnumType, HashMap<i16, String>)
Map([Box<DataTypeNode>; 2])
Key-Value pairs are defined as an array, so it can be used as a slice
AggregateFunction(String, Vec<DataTypeNode>)
Function name and its arguments
SimpleAggregateFunction(String, Box<DataTypeNode>)
Function name and the inner type. The wire format is identical to the inner type; the function name is metadata for the MergeTree engine, not the client protocol.
Variant(Vec<DataTypeNode>)
Contains all possible types for this variant
Dynamic
JSON
JsonWithHint(Vec<(String, Box<DataTypeNode>)>)
Point
Ring
LineString
MultiLineString
Polygon
MultiPolygon
Implementations§
Source§impl DataTypeNode
impl DataTypeNode
Sourcepub fn new(name: &str) -> Result<DataTypeNode, TypesError>
pub fn new(name: &str) -> Result<DataTypeNode, TypesError>
Parses a data type from a string that is received
in the RowBinaryWithNamesAndTypes and Native formats headers.
See also: https://clickhouse.com/docs/interfaces/formats/RowBinaryWithNamesAndTypes#description
Sourcepub fn remove_low_cardinality(&self) -> &DataTypeNode
pub fn remove_low_cardinality(&self) -> &DataTypeNode
LowCardinality(T) -> T
Sourcepub fn remove_simple_aggregate_function(&self) -> &DataTypeNode
pub fn remove_simple_aggregate_function(&self) -> &DataTypeNode
SimpleAggregateFunction(fn, T) -> T
The wire format of a SimpleAggregateFunction column is identical to
its inner type. This method strips the wrapper so that (de)serialization
validation can treat it as the inner type.
Sourcepub fn remove_compatible_wrappers(&self) -> &DataTypeNode
pub fn remove_compatible_wrappers(&self) -> &DataTypeNode
Remove wrapper types that are semantically identical from a data consumer’s perspective.
N.B. Nullable is not a valid lift here as nullable column data is not compatible with
a non-nullable Rust type and vice versa
(e.g. Nullable(UInt64) is not strictly compatible with u64).
Current types covered:
LowCardinalitySimpleAggregateFunction
Trait Implementations§
Source§impl Clone for DataTypeNode
impl Clone for DataTypeNode
Source§fn clone(&self) -> DataTypeNode
fn clone(&self) -> DataTypeNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more