Skip to main content

ArrowExportVTable

Trait ArrowExportVTable 

Source
pub trait ArrowExportVTable:
    'static
    + Send
    + Sync
    + Debug {
    // Required methods
    fn arrow_ext_id(&self) -> Id;
    fn vortex_ext_id(&self) -> ExtId;
    fn to_arrow_field(
        &self,
        name: &str,
        dtype: &ExtDTypeRef,
        session: &ArrowSession,
    ) -> VortexResult<Option<Field>>;
    fn execute_arrow(
        &self,
        array: ArrayRef,
        target: &Field,
        ctx: &mut ExecutionCtx,
    ) -> VortexResult<ArrowExport>;
}
Expand description

Plugin layer for exporting a Vortex array to an Arrow extension type.

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 ID this plugin produces.

Source

fn vortex_ext_id(&self) -> ExtId

The Vortex extension ID this plugin maps from. Used only for inference by ArrowSession::to_arrow_field / ArrowSession::to_arrow_schema; never as a dispatch key for execute_arrow.

Source

fn to_arrow_field( &self, name: &str, dtype: &ExtDTypeRef, session: &ArrowSession, ) -> VortexResult<Option<Field>>

Build the Arrow Field this plugin produces for the given Vortex extension dtype. Used during schema inference.

Source

fn execute_arrow( &self, array: ArrayRef, target: &Field, ctx: &mut ExecutionCtx, ) -> VortexResult<ArrowExport>

Convert a Vortex array into an Arrow array shaped to target.

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

Implementors§