Skip to main content

CastReduce

Trait CastReduce 

Source
pub trait CastReduce: VTable {
    // Required method
    fn cast(
        array: ArrayView<'_, Self>,
        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: ArrayView<'_, Self>, 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 Bool

Source§

impl CastReduce for Chunked

Source§

impl CastReduce for Constant

Source§

impl CastReduce for Decimal

Source§

impl CastReduce for Dict

Source§

impl CastReduce for Extension

Source§

impl CastReduce for FixedSizeList

Cast implementation for FixedSizeListArray.

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

Source§

impl CastReduce for List

Source§

impl CastReduce for ListView

Source§

impl CastReduce for Null

Source§

impl CastReduce for Primitive

Source§

impl CastReduce for Struct

Push the cast into struct fields without execution.

Supports schema evolution by allowing new nullable fields to be added during the cast, filled with null values. For nullability changes, only handles the cheap path (try_cast_nullability); when statistics computation is required to determine whether the array contains invalid values, returns Ok(None) so CastKernel can run instead.

Source§

impl CastReduce for VarBin

Source§

impl CastReduce for VarBinView