pub enum ColumnType {
Show 26 variants
Int8,
Int16,
Int32,
Int64,
Uint8,
Uint16,
Uint32,
Uint64,
Float,
Double,
Boolean,
String,
Utf8,
Any,
Date,
Datetime,
Timestamp,
Interval,
Date32,
Datetime64,
Timestamp64,
Interval64,
Json,
Uuid,
Void,
Null,
}Expand description
A column’s type, in the type spelling.
The primitives a job’s row can hold. Composite types — lists, structs,
tuples — are out of scope here; a column holding one is described as
ColumnType::Any, which is what YTsaurus stores an arbitrary YSON value
as.
These are the type names. YTsaurus has a second, newer spelling,
type_v3, and exactly two names differ between them: boolean is bool
there, and any is yson. Sending a type_v3 name in a type field is
refused — Error parsing ESimpleLogicalValueType value "bool" — so the two
vocabularies must not be mixed. Every other name is the same string in both.
Variants§
Int8
8-bit signed integer.
Int16
16-bit signed integer.
Int32
32-bit signed integer.
Int64
64-bit signed integer.
Uint8
8-bit unsigned integer.
Uint16
16-bit unsigned integer.
Uint32
32-bit unsigned integer.
Uint64
64-bit unsigned integer.
Float
Single-precision float.
Double
Double-precision float.
Boolean
Boolean.
String
A byte string. YTsaurus strings are arbitrary bytes, not text.
Utf8
A string the cluster checks is valid UTF-8.
Any
Any YSON value, stored as-is.
Never required: the cluster answers Column of type "any" cannot be "required".
Date
Days since the Unix epoch, unsigned.
Datetime
Seconds since the Unix epoch, unsigned.
Timestamp
Microseconds since the Unix epoch, unsigned.
Interval
A signed count of microseconds.
Date32
Signed days since the Unix epoch.
Datetime64
Signed seconds since the Unix epoch.
Timestamp64
Signed microseconds since the Unix epoch.
Interval64
A signed count of microseconds, over the wider range.
Json
UTF-8 text the cluster checks is valid JSON.
Uuid
A 16-byte UUID.
Void
A column that holds nothing.
Reads back as required=%false without an optional wrapper, unlike
every other type.
Null
The type with no values at all.
Implementations§
Source§impl ColumnType
impl ColumnType
Sourcepub fn can_be_required(self) -> bool
pub fn can_be_required(self) -> bool
Whether a column of this type may be declared required.
Three types may not, and the cluster says so in as many words —
Column of type "any" cannot be "required", Null type cannot be required, and the same for void. Each of them already means “there
may be nothing here”, so promising a value would contradict the type.
Sourcepub fn parse(name: &str) -> Option<Self>
pub fn parse(name: &str) -> Option<Self>
Parses a wire name, for the derive’s #[yt(column_type = "…")] escape
hatch and for anyone building a schema from configuration.
Accepts either vocabulary — bool and yson are understood as the
type_v3 spellings of boolean and any — but what comes back is
always the type spelling, which is the one this crate sends.
Not FromStr: an unknown type name is not an error worth a type of its
own, and every caller here wants the Option.
Trait Implementations§
Source§impl Clone for ColumnType
impl Clone for ColumnType
Source§fn clone(&self) -> ColumnType
fn clone(&self) -> ColumnType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more