evolution_schema::column

Struct FixedColumn

source
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

source

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.

source

pub fn name(&self) -> &String

Get the name of the column.

source

pub fn offset(&self) -> usize

Get the starting offset of the column (in runes).

source

pub fn length(&self) -> usize

Get the total length of the column (in runes).

source

pub fn dtype(&self) -> DataType

Get the datatype of the column (as a DataType variant).

source

pub fn alignment(&self) -> Alignment

Get the alignment mode of the column (as an Alignment variant).

source

pub fn pad_symbol(&self) -> Symbol

Get the symbol used to pad the column to its expected length (as a Symbol variant).

source

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.

source

pub fn as_arrow_dtype(&self) -> ArrowDataType

Get the datatype of the column as a ArrowDataType variant.

source

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.

source

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

source§

fn clone(&self) -> FixedColumn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for FixedColumn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for FixedColumn

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for FixedColumn

source§

fn eq(&self, other: &FixedColumn) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for FixedColumn

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Column for FixedColumn

source§

impl StructuralPartialEq for FixedColumn

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,