Skip to main content

TypeMapper

Struct TypeMapper 

Source
pub struct TypeMapper;
Expand description

Type mapper for converting between Exasol and Arrow types.

Implementations§

Source§

impl TypeMapper

Source

pub fn exasol_to_arrow( exasol_type: &ExasolType, nullable: bool, ) -> Result<DataType, ConversionError>

Convert an Exasol type to an Arrow DataType.

§Arguments
  • exasol_type - The Exasol type to convert
  • nullable - Whether the field is nullable
§Returns

The corresponding Arrow DataType

§Errors

Returns ConversionError::UnsupportedType if the type cannot be mapped

Source

pub fn arrow_to_exasol( arrow_type: &DataType, ) -> Result<ExasolType, ConversionError>

Convert an Arrow DataType to an Exasol type.

This is used for parameter binding and type inference.

§Arguments
  • arrow_type - The Arrow type to convert
§Returns

The corresponding Exasol type

§Errors

Returns ConversionError::UnsupportedType if the type cannot be mapped

Source

pub fn create_field_metadata( exasol_type: &ExasolType, ) -> HashMap<String, String>

Create Arrow field metadata to preserve Exasol type information.

This allows round-tripping type information.

Source

pub fn from_field_metadata( metadata: &HashMap<String, String>, ) -> Option<ExasolType>

Extract Exasol type from Arrow field metadata.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

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