pub enum DType {
Null,
Bool(Nullability),
Primitive(PType, Nullability),
Decimal(DecimalDType, Nullability),
Utf8(Nullability),
Binary(Nullability),
Struct(Arc<StructDType>, Nullability),
List(Arc<DType>, Nullability),
Extension(Arc<ExtDType>),
}Expand description
The logical types of elements in Vortex arrays.
Vortex arrays preserve a single logical type, while the encodings allow for multiple physical ways to encode that type.
Variants§
Null
The logical null type (only has a single value, null)
Bool(Nullability)
The logical boolean type (true or false if non-nullable; true, false, or null if nullable)
Primitive(PType, Nullability)
Primitive, fixed-width numeric types (e.g., u8, i8, u16, i16, u32, i32, u64, i64, f32, f64)
Decimal(DecimalDType, Nullability)
Real numbers with fixed exact precision and scale.
Utf8(Nullability)
UTF-8 strings
Binary(Nullability)
Binary data
Struct(Arc<StructDType>, Nullability)
A struct is composed of an ordered list of fields, each with a corresponding name and DType
List(Arc<DType>, Nullability)
A variable-length list type, parameterized by a single element DType
Extension(Arc<ExtDType>)
User-defined extension types
Implementations§
Source§impl DType
impl DType
Sourcepub fn to_arrow_schema(&self) -> VortexResult<Schema>
pub fn to_arrow_schema(&self) -> VortexResult<Schema>
Sourcepub fn to_arrow_dtype(&self) -> VortexResult<DataType>
pub fn to_arrow_dtype(&self) -> VortexResult<DataType>
Source§impl DType
impl DType
Sourcepub fn nullability(&self) -> Nullability
pub fn nullability(&self) -> Nullability
Get the nullability of the DType
Sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Check if the DType is nullable
Sourcepub fn as_nonnullable(&self) -> Self
pub fn as_nonnullable(&self) -> Self
Get a new DType with Nullability::NonNullable (but otherwise the same as self)
Sourcepub fn as_nullable(&self) -> Self
pub fn as_nullable(&self) -> Self
Get a new DType with Nullability::Nullable (but otherwise the same as self)
Sourcepub fn with_nullability(&self, nullability: Nullability) -> Self
pub fn with_nullability(&self, nullability: Nullability) -> Self
Get a new DType with the given nullability (but otherwise the same as self)
Sourcepub fn union_nullability(&self, other: Nullability) -> Self
pub fn union_nullability(&self, other: Nullability) -> Self
Union the nullability of this dtype with the other nullability, returning a new dtype.
Sourcepub fn eq_ignore_nullability(&self, other: &Self) -> bool
pub fn eq_ignore_nullability(&self, other: &Self) -> bool
Check if self and other are equal, ignoring nullability
Sourcepub fn is_primitive(&self) -> bool
pub fn is_primitive(&self) -> bool
Check if self is a primitive tpye
Sourcepub fn to_ptype(&self) -> PType
pub fn to_ptype(&self) -> PType
Returns this DType’s PType if it is a primitive type, otherwise panics.
Sourcepub fn is_unsigned_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
Check if self is an unsigned integer
Sourcepub fn is_signed_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
Check if self is a signed integer
Sourcepub fn is_boolean(&self) -> bool
pub fn is_boolean(&self) -> bool
Check if self is a boolean
Sourcepub fn is_extension(&self) -> bool
pub fn is_extension(&self) -> bool
Check if self is an extension type
Sourcepub fn is_decimal(&self) -> bool
pub fn is_decimal(&self) -> bool
Check if self is a decimal type
Sourcepub fn as_decimal(&self) -> Option<&DecimalDType>
pub fn as_decimal(&self) -> Option<&DecimalDType>
Check returns the inner decimal type if the dtype is a decimal
Sourcepub fn as_struct(&self) -> Option<&Arc<StructDType>>
pub fn as_struct(&self) -> Option<&Arc<StructDType>>
Get the StructDType if self is a StructDType, otherwise None
Sourcepub fn as_list_element(&self) -> Option<&DType>
pub fn as_list_element(&self) -> Option<&DType>
Get the inner dtype if self is a ListDType, otherwise None
Source§impl DType
impl DType
Sourcepub fn try_from_view(fb: DType<'_>, buffer: FlatBuffer) -> VortexResult<Self>
pub fn try_from_view(fb: DType<'_>, buffer: FlatBuffer) -> VortexResult<Self>
Create a new
Trait Implementations§
Source§impl From<DType> for FieldDType
impl From<DType> for FieldDType
Source§impl FromArrowType<&Field> for DType
impl FromArrowType<&Field> for DType
Source§fn from_arrow(field: &Field) -> Self
fn from_arrow(field: &Field) -> Self
Source§impl FromArrowType<&Schema> for DType
impl FromArrowType<&Schema> for DType
Source§fn from_arrow(value: &Schema) -> Self
fn from_arrow(value: &Schema) -> Self
Source§impl FromArrowType<(&DataType, Nullability)> for DType
impl FromArrowType<(&DataType, Nullability)> for DType
Source§fn from_arrow((data_type, nullability): (&DataType, Nullability)) -> Self
fn from_arrow((data_type, nullability): (&DataType, Nullability)) -> Self
Source§impl FromArrowType<Arc<Schema>> for DType
impl FromArrowType<Arc<Schema>> for DType
Source§fn from_arrow(value: SchemaRef) -> Self
fn from_arrow(value: SchemaRef) -> Self
Source§impl TryFrom<&DType> for DecimalDType
impl TryFrom<&DType> for DecimalDType
Source§impl TryFrom<&DType> for PType
impl TryFrom<&DType> for PType
Source§type Error = VortexError
type Error = VortexError
Source§fn try_from(value: &DType) -> VortexResult<Self>
fn try_from(value: &DType) -> VortexResult<Self>
Source§impl TryFrom<DType> for DecimalDType
impl TryFrom<DType> for DecimalDType
Source§impl WriteFlatBuffer for DType
impl WriteFlatBuffer for DType
type Target<'a> = DType<'a>
fn write_flatbuffer<'fb>( &self, fbb: &mut FlatBufferBuilder<'fb>, ) -> WIPOffset<Self::Target<'fb>>
impl Eq for DType
impl FlatBufferRoot for DType
impl StructuralPartialEq for DType
Auto Trait Implementations§
impl Freeze for DType
impl RefUnwindSafe for DType
impl Send for DType
impl Sync for DType
impl Unpin for DType
impl UnwindSafe for DType
Blanket Implementations§
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> 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<F> WriteFlatBufferExt for Fwhere
F: WriteFlatBuffer + FlatBufferRoot,
impl<F> WriteFlatBufferExt for Fwhere
F: WriteFlatBuffer + FlatBufferRoot,
Source§fn write_flatbuffer_bytes(&self) -> ConstBuffer<u8, 8>
fn write_flatbuffer_bytes(&self) -> ConstBuffer<u8, 8>
FlatBuffer.