Skip to main content

BinaryCombined

Trait BinaryCombined 

Source
pub trait BinaryCombined:
    'static
    + Send
    + Sync
    + Clone {
    type Left: AggregateFnVTable;
    type Right: AggregateFnVTable;

    // Required methods
    fn id(&self) -> AggregateFnId;
    fn left(&self) -> Self::Left;
    fn right(&self) -> Self::Right;
    fn return_dtype(&self, input_dtype: &DType) -> Option<DType>;
    fn finalize(
        &self,
        left: ArrayRef,
        right: ArrayRef,
    ) -> VortexResult<ArrayRef>;
    fn finalize_scalar(
        &self,
        left_scalar: Scalar,
        right_scalar: Scalar,
    ) -> VortexResult<Scalar>;

    // Provided methods
    fn left_name(&self) -> &'static str { ... }
    fn right_name(&self) -> &'static str { ... }
    fn serialize(
        &self,
        options: &CombinedOptions<Self>,
    ) -> VortexResult<Option<Vec<u8>>> { ... }
    fn deserialize(
        &self,
        metadata: &[u8],
        session: &VortexSession,
    ) -> VortexResult<CombinedOptions<Self>> { ... }
    fn coerce_args(
        &self,
        options: &CombinedOptions<Self>,
        input_dtype: &DType,
    ) -> VortexResult<DType> { ... }
    fn partial_struct_dtype(&self, left: DType, right: DType) -> DType { ... }
}
Expand description

Declare an aggregate function in terms of two child aggregates.

Required Associated Types§

Source

type Left: AggregateFnVTable

The left child aggregate vtable.

Source

type Right: AggregateFnVTable

The right child aggregate vtable.

Required Methods§

Source

fn id(&self) -> AggregateFnId

Stable identifier for the combined aggregate.

Source

fn left(&self) -> Self::Left

Construct the left child vtable.

Source

fn right(&self) -> Self::Right

Construct the right child vtable.

Source

fn return_dtype(&self, input_dtype: &DType) -> Option<DType>

Return type of the combined aggregate.

Source

fn finalize(&self, left: ArrayRef, right: ArrayRef) -> VortexResult<ArrayRef>

Combine the finalized left and right results into the final aggregate.

Source

fn finalize_scalar( &self, left_scalar: Scalar, right_scalar: Scalar, ) -> VortexResult<Scalar>

Provided Methods§

Source

fn left_name(&self) -> &'static str

Field name for the left child in the partial struct dtype.

Source

fn right_name(&self) -> &'static str

Field name for the right child in the partial struct dtype.

Source

fn serialize( &self, options: &CombinedOptions<Self>, ) -> VortexResult<Option<Vec<u8>>>

Serialize the options for this combined aggregate. Default: not serializable.

Source

fn deserialize( &self, metadata: &[u8], session: &VortexSession, ) -> VortexResult<CombinedOptions<Self>>

Deserialize the options for this combined aggregate. Default: bails.

Source

fn coerce_args( &self, options: &CombinedOptions<Self>, input_dtype: &DType, ) -> VortexResult<DType>

Coerce the input type. Default: chains right.coerce_args(left.coerce_args(input)).

Source

fn partial_struct_dtype(&self, left: DType, right: DType) -> DType

Build the partial struct dtype that wraps the two child partials.

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§