pub enum DataType {
Primitive(PrimitiveType),
Array(Box<ArrayType>),
Struct(Box<StructType>),
Map(Box<MapType>),
Variant(Box<StructType>),
}Variants§
Primitive(PrimitiveType)
UTF-8 encoded string of characters
Array(Box<ArrayType>)
An array stores a variable length collection of items of some type.
Struct(Box<StructType>)
A struct is used to represent both the top-level schema of the table as well as struct columns that contain nested columns.
Map(Box<MapType>)
A map stores an arbitrary length collection of key-value pairs with a single keyType and a single valueType
Variant(Box<StructType>)
The Variant data type. The physical representation can be flexible to support shredded
reads. The unshredded schema is Variant(StructType<metadata: BINARY, value: BINARY>).
Implementations§
Source§impl DataType
cbindgen:ignore
impl DataType
cbindgen:ignore
pub const STRING: Self
pub const LONG: Self
pub const INTEGER: Self
pub const SHORT: Self
pub const BYTE: Self
pub const FLOAT: Self
pub const DOUBLE: Self
pub const BOOLEAN: Self
pub const BINARY: Self
pub const DATE: Self
pub const TIMESTAMP: Self
pub const TIMESTAMP_NTZ: Self
Sourcepub fn decimal(precision: u8, scale: u8) -> DeltaResult<Self>
pub fn decimal(precision: u8, scale: u8) -> DeltaResult<Self>
Create a new decimal type with the given precision and scale.
Sourcepub fn try_struct_type(
fields: impl IntoIterator<Item = StructField>,
) -> DeltaResult<Self>
pub fn try_struct_type( fields: impl IntoIterator<Item = StructField>, ) -> DeltaResult<Self>
Create a new struct type with the given fields.
Sourcepub fn try_struct_type_from_results<E: Into<Error>>(
fields: impl IntoIterator<Item = Result<StructField, E>>,
) -> DeltaResult<Self>
pub fn try_struct_type_from_results<E: Into<Error>>( fields: impl IntoIterator<Item = Result<StructField, E>>, ) -> DeltaResult<Self>
Create a new struct type from a fallible iterator of fields.
Sourcepub fn unshredded_variant() -> Self
pub fn unshredded_variant() -> Self
Create a new unshredded DataType::Variant. This data type is a struct of two not-null
binary fields: metadata and value.
Sourcepub fn variant_type(
fields: impl IntoIterator<Item = StructField>,
) -> DeltaResult<Self>
pub fn variant_type( fields: impl IntoIterator<Item = StructField>, ) -> DeltaResult<Self>
Create a new DataType::Variant from the provided fields. For unshredded variants, you
should prefer using DataType::unshredded_variant.
Sourcepub fn as_primitive_opt(&self) -> Option<&PrimitiveType>
pub fn as_primitive_opt(&self) -> Option<&PrimitiveType>
Attempt to convert this data type to a PrimitiveType. Returns None if this is a
non-primitive type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DataType
impl<'de> Deserialize<'de> for DataType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<DecimalType> for DataType
impl From<DecimalType> for DataType
Source§fn from(dtype: DecimalType) -> Self
fn from(dtype: DecimalType) -> Self
Source§impl From<PrimitiveType> for DataType
impl From<PrimitiveType> for DataType
Source§fn from(ptype: PrimitiveType) -> Self
fn from(ptype: PrimitiveType) -> Self
Source§impl From<StructType> for DataType
impl From<StructType> for DataType
Source§fn from(struct_type: StructType) -> Self
fn from(struct_type: StructType) -> Self
Source§impl TryFromArrow<&DataType> for DataType
Available on crate feature arrow-conversion and (crate features default-engine-native-tls or default-engine-rustls or arrow-conversion) only.
impl TryFromArrow<&DataType> for DataType
arrow-conversion and (crate features default-engine-native-tls or default-engine-rustls or arrow-conversion) only.fn try_from_arrow(arrow_datatype: &ArrowDataType) -> Result<Self, ArrowError>
Source§impl TryFromKernel<&DataType> for DataType
Available on crate feature arrow-conversion and (crate features default-engine-native-tls or default-engine-rustls or arrow-conversion) only.
impl TryFromKernel<&DataType> for DataType
arrow-conversion and (crate features default-engine-native-tls or default-engine-rustls or arrow-conversion) only.fn try_from_kernel(t: &DataType) -> Result<Self, ArrowError>
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
Blanket Implementations§
Source§impl<T> AsAny for T
impl<T> AsAny for T
Source§fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
fn any_ref(&self) -> &(dyn Any + Send + Sync + 'static)
dyn Any reference to the object: Read moreSource§fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
fn as_any(self: Arc<T>) -> Arc<dyn Any + Send + Sync>
Arc<dyn Any> reference to the object: Read moreSource§fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
fn into_any(self: Box<T>) -> Box<dyn Any + Send + Sync>
Box<dyn Any>: Read moreSource§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
std::any::type_name, since Any does not provide it and
Any::type_id is useless as a debugging aid (its Debug is just a mess of hex digits).Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DynPartialEq for T
impl<T> DynPartialEq for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.
Source§impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelTypewhere
ArrowType: TryFromKernel<KernelType>,
impl<KernelType, ArrowType> TryIntoArrow<ArrowType> for KernelTypewhere
ArrowType: TryFromKernel<KernelType>,
Source§fn try_into_arrow(self) -> Result<ArrowType, ArrowError>
fn try_into_arrow(self) -> Result<ArrowType, ArrowError>
default-engine-native-tls or default-engine-rustls or arrow-conversion) and crate feature arrow-conversion only.Source§impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowTypewhere
KernelType: TryFromArrow<ArrowType>,
impl<KernelType, ArrowType> TryIntoKernel<KernelType> for ArrowTypewhere
KernelType: TryFromArrow<ArrowType>,
Source§fn try_into_kernel(self) -> Result<KernelType, ArrowError>
fn try_into_kernel(self) -> Result<KernelType, ArrowError>
default-engine-native-tls or default-engine-rustls or arrow-conversion) and crate feature arrow-conversion only.