Skip to main content

ArrowImportVTable

Trait ArrowImportVTable 

Source
pub trait ArrowImportVTable:
    'static
    + Send
    + Sync
    + Debug {
    // Required methods
    fn arrow_ext_id(&self) -> Id;
    fn from_arrow_field(
        &self,
        field: &Field,
        session: &ArrowSession,
    ) -> VortexResult<Option<DType>>;
    fn from_arrow_array(
        &self,
        array: ArrowArrayRef,
        field: &Field,
        dtype: &DType,
        session: &ArrowSession,
    ) -> VortexResult<ArrowImport>;
}
Expand description

Plugin layer for importing an Arrow extension-typed array into a Vortex array.

Plugins are dispatched by arrow_ext_id.

This is purely an implementation trait, its methods should not be called directly. Instead, use the methods on ArrowSession.

Required Methods§

Source

fn arrow_ext_id(&self) -> Id

The Arrow extension name this plugin handles.

Source

fn from_arrow_field( &self, field: &Field, session: &ArrowSession, ) -> VortexResult<Option<DType>>

Build the Vortex DType that corresponds to field (which carries this plugin’s Arrow extension metadata).

session is provided so plugins can resolve nested or storage fields through the plugin-aware conversion (e.g. ArrowSession::from_arrow_datatype) instead of the naive Arrow → Vortex mapping.

Source

fn from_arrow_array( &self, array: ArrowArrayRef, field: &Field, dtype: &DType, session: &ArrowSession, ) -> VortexResult<ArrowImport>

Convert an Arrow array into a Vortex array of dtype.

Returns ownership of array via ArrowImport::Unsupported when the plugin cannot handle the input.

session is provided so plugins can convert storage or nested arrays through the session (e.g. ArrowSession::from_arrow_array, passing a nullability rather than a Field so the plugin is not dispatched again).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§