Skip to main content

ToArrowType

Trait ToArrowType 

Source
pub trait ToArrowType {
    // Required methods
    fn to_arrow_schema(&self) -> VortexResult<Schema>;
    fn to_arrow_dtype(&self) -> VortexResult<DataType>;
}
Expand description

Extension trait converting Vortex DTypes into Arrow schemas and data types.

This mirrors inherent methods that lived on DType before Arrow interoperability moved into this crate.

Required Methods§

Source

fn to_arrow_schema(&self) -> VortexResult<Schema>

Convert a Vortex DType into an Arrow Schema.

Prefer ArrowSession::to_arrow_schema. This method is not plugin-aware and strips any ARROW:extension:name metadata for non-builtin extensions (only arrow.parquet.variant is special-cased here). Use the session method when you need round-trippable extension metadata.

Source

fn to_arrow_dtype(&self) -> VortexResult<DataType>

👎Deprecated:

Use ArrowSession::to_arrow_datatype instead

Returns the Arrow DataType that best corresponds to this Vortex DType.

Prefer ArrowSession::to_arrow_datatype (or to_arrow_field). This method has no awareness of registered Arrow extension plugins, so any DType::Extension outside the builtin temporal set will fail or silently lose its ARROW:extension:name metadata. The session methods recurse through containers and dispatch plugins at every extension node.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToArrowType for DType

Source§

fn to_arrow_schema(&self) -> VortexResult<Schema>

Source§

fn to_arrow_dtype(&self) -> VortexResult<DataType>

👎Deprecated:

Use ArrowSession::to_arrow_datatype instead

Implementors§