pub struct FixedColumn { /* private fields */ }Expand description
Representation of a column in a fixed-length file (.flf), containing the only allowed fields.
§Note
This struct is meant to be created when deserializing a .json schema file representing a crate::schema::FixedSchema,
and as such, capitalization of the field values is extremely important. For example, the dtype field has to be exactly
one of the DataType enum variants, spelled exactly the same. Otherwise, serde can’t deserialize the values.
Implementations§
source§impl FixedColumn
impl FixedColumn
sourcepub fn new(
name: String,
offset: usize,
length: usize,
dtype: DataType,
alignment: Alignment,
pad_symbol: Symbol,
is_nullable: bool,
) -> Self
pub fn new( name: String, offset: usize, length: usize, dtype: DataType, alignment: Alignment, pad_symbol: Symbol, is_nullable: bool, ) -> Self
Create a new FixedColumn from the provided field values.
sourcepub fn alignment(&self) -> Alignment
pub fn alignment(&self) -> Alignment
Get the alignment mode of the column (as an Alignment variant).
sourcepub fn pad_symbol(&self) -> Symbol
pub fn pad_symbol(&self) -> Symbol
Get the symbol used to pad the column to its expected length (as a Symbol variant).
sourcepub fn is_nullable(&self) -> bool
pub fn is_nullable(&self) -> bool
Get whether or not the column is allowed to be nullable.
§Note
If a column is defined as not nullable and parsing of a fixed-length file column fails to find a valid value, then a NULL value will not be appended to the column builder. Instead, the program will terminate due to this occurring.
sourcepub fn as_arrow_dtype(&self) -> ArrowDataType
pub fn as_arrow_dtype(&self) -> ArrowDataType
Get the datatype of the column as a ArrowDataType variant.
sourcepub fn as_delta_dtype(&self) -> DeltaDataType
pub fn as_delta_dtype(&self) -> DeltaDataType
Get the datatype of the column as a DeltaDataType variant.
§Note
Currently this method will map DataType::Float16 to the DataType::Float32 variant. This
is because the deltalake crate does not yet define a Float16 variant in its DeltaDataType.
sourcepub fn as_column_builder(&self) -> ColumnBuilderRef
pub fn as_column_builder(&self) -> ColumnBuilderRef
Create a new ColumnBuilderRef based on the datatype of the column.
§Performance
This method will clone the String which contains the name of the column. You should only use this during setup of the program, and not during any performance critical parts of the program.
Trait Implementations§
source§impl Clone for FixedColumn
impl Clone for FixedColumn
source§fn clone(&self) -> FixedColumn
fn clone(&self) -> FixedColumn
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for FixedColumn
impl Debug for FixedColumn
source§impl<'de> Deserialize<'de> for FixedColumn
impl<'de> Deserialize<'de> for FixedColumn
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 PartialEq for FixedColumn
impl PartialEq for FixedColumn
source§impl Serialize for FixedColumn
impl Serialize for FixedColumn
impl Column for FixedColumn
impl StructuralPartialEq for FixedColumn
Auto Trait Implementations§
impl Freeze for FixedColumn
impl RefUnwindSafe for FixedColumn
impl Send for FixedColumn
impl Sync for FixedColumn
impl Unpin for FixedColumn
impl UnwindSafe for FixedColumn
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)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 more