Skip to main content

CastReduce

Trait CastReduce 

Source
pub trait CastReduce: VTable {
    // Required method
    fn cast(
        array: &Self::Array,
        dtype: &DType,
    ) -> VortexResult<Option<ArrayRef>>;
}
Expand description

Reduce rule for cast: restructure the array without reading buffers.

Encodings implement this to push cast operations through their structure. For example, RunEnd pushes cast down to its values array, ZigZag transforms the target dtype to unsigned and pushes to its encoded array.

Returns Ok(None) if the rule doesn’t apply to this array/dtype combination.

Required Methods§

Source

fn cast(array: &Self::Array, dtype: &DType) -> VortexResult<Option<ArrayRef>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl CastReduce for BoolVTable

Source§

impl CastReduce for ChunkedVTable

Source§

impl CastReduce for ConstantVTable

Source§

impl CastReduce for DictVTable

Source§

impl CastReduce for ExtensionVTable

Source§

impl CastReduce for FixedSizeListVTable

Cast implementation for FixedSizeListArray.

Recursively casts the inner elements array to the target element type while preserving the list structure.

Source§

impl CastReduce for ListVTable

Source§

impl CastReduce for ListViewVTable

Source§

impl CastReduce for NullVTable

Source§

impl CastReduce for VarBinVTable

Source§

impl CastReduce for VarBinViewVTable