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§
Sourcetype Left: AggregateFnVTable
type Left: AggregateFnVTable
The left child aggregate vtable.
Sourcetype Right: AggregateFnVTable
type Right: AggregateFnVTable
The right child aggregate vtable.
Required Methods§
Sourcefn id(&self) -> AggregateFnId
fn id(&self) -> AggregateFnId
Stable identifier for the combined aggregate.
Sourcefn return_dtype(&self, input_dtype: &DType) -> Option<DType>
fn return_dtype(&self, input_dtype: &DType) -> Option<DType>
Return type of the combined aggregate.
Sourcefn finalize(&self, left: ArrayRef, right: ArrayRef) -> VortexResult<ArrayRef>
fn finalize(&self, left: ArrayRef, right: ArrayRef) -> VortexResult<ArrayRef>
Combine the finalized left and right results into the final aggregate.
fn finalize_scalar( &self, left_scalar: Scalar, right_scalar: Scalar, ) -> VortexResult<Scalar>
Provided Methods§
Sourcefn right_name(&self) -> &'static str
fn right_name(&self) -> &'static str
Field name for the right child in the partial struct dtype.
Sourcefn serialize(
&self,
options: &CombinedOptions<Self>,
) -> VortexResult<Option<Vec<u8>>>
fn serialize( &self, options: &CombinedOptions<Self>, ) -> VortexResult<Option<Vec<u8>>>
Serialize the options for this combined aggregate. Default: not serializable.
Sourcefn deserialize(
&self,
metadata: &[u8],
session: &VortexSession,
) -> VortexResult<CombinedOptions<Self>>
fn deserialize( &self, metadata: &[u8], session: &VortexSession, ) -> VortexResult<CombinedOptions<Self>>
Deserialize the options for this combined aggregate. Default: bails.
Sourcefn coerce_args(
&self,
options: &CombinedOptions<Self>,
input_dtype: &DType,
) -> VortexResult<DType>
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)).
Sourcefn partial_struct_dtype(&self, left: DType, right: DType) -> DType
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.