Trait mz_persist_types::columnar::Schema2

source ·
pub trait Schema2<T>:
    Debug
    + Send
    + Sync {
    type ArrowColumn: Array + Debug + Clone + 'static;
    type Statistics: DynStats + 'static;
    type Decoder: ColumnDecoder<T> + Debug + Send + Sync;
    type Encoder: ColumnEncoder<T, FinishedColumn = Self::ArrowColumn> + Debug;

    // Required methods
    fn decoder(&self, col: Self::ArrowColumn) -> Result<Self::Decoder, Error>;
    fn encoder(&self) -> Result<Self::Encoder, Error>;

    // Provided method
    fn decoder_any(&self, col: &dyn Array) -> Result<Self::Decoder, Error> { ... }
}
Expand description

Description of a type that we encode into Persist.

Required Associated Types§

source

type ArrowColumn: Array + Debug + Clone + 'static

The type of column we decode from, and encoder will finish into.

source

type Statistics: DynStats + 'static

Statistics we collect for a schema of this type.

source

type Decoder: ColumnDecoder<T> + Debug + Send + Sync

Type that is able to decode values of T from Self::ArrowColumn.

source

type Encoder: ColumnEncoder<T, FinishedColumn = Self::ArrowColumn> + Debug

Type that is able to encoder values of T.

Required Methods§

source

fn decoder(&self, col: Self::ArrowColumn) -> Result<Self::Decoder, Error>

Returns a type that is able to decode instances of T from the provider column.

source

fn encoder(&self) -> Result<Self::Encoder, Error>

Returns a type that can encode values of T.

Provided Methods§

source

fn decoder_any(&self, col: &dyn Array) -> Result<Self::Decoder, Error>

Returns a type that is able to decode instances of T from a type erased arrow::array::Array, erroring if the provided array is not Self::ArrowColumn.

Implementors§