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§
sourcetype ArrowColumn: Array + Debug + Clone + 'static
type ArrowColumn: Array + Debug + Clone + 'static
The type of column we decode from, and encoder will finish into.
sourcetype Statistics: DynStats + 'static
type Statistics: DynStats + 'static
Statistics we collect for a schema of this type.
sourcetype Decoder: ColumnDecoder<T> + Debug + Send + Sync
type Decoder: ColumnDecoder<T> + Debug + Send + Sync
Type that is able to decode values of T
from Self::ArrowColumn
.
sourcetype Encoder: ColumnEncoder<T, FinishedColumn = Self::ArrowColumn> + Debug
type Encoder: ColumnEncoder<T, FinishedColumn = Self::ArrowColumn> + Debug
Type that is able to encoder values of T
.
Required Methods§
Provided Methods§
sourcefn decoder_any(&self, col: &dyn Array) -> Result<Self::Decoder, Error>
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
.