Skip to main content

DynGroupedAggregateKernel

Trait DynGroupedAggregateKernel 

Source
pub trait DynGroupedAggregateKernel:
    'static
    + Send
    + Sync
    + Debug {
    // Required method
    fn grouped_aggregate(
        &self,
        aggregate_fn: &AggregateFnRef,
        groups: &GroupedArray,
        ctx: &mut ExecutionCtx,
    ) -> VortexResult<Option<ArrayRef>>;
}
Expand description

A pluggable kernel for batch aggregation of many groups.

A kernel can be registered either for an aggregate function regardless of the element encoding, or for a specific aggregate function and element encoding. Element-encoding kernels are matched on the inner array of the provided grouped array, not on the outer list encoding. This is more pragmatic than having every kernel match on the outer list encoding and having to deal with the possibility of multiple list encodings.

Each value in the grouped array represents a group and the result of the grouped aggregate should be an array of the same length, where each element is the aggregate state of the corresponding group.

Return Ok(None) if the kernel cannot be applied to the given aggregate function.

Required Methods§

Source

fn grouped_aggregate( &self, aggregate_fn: &AggregateFnRef, groups: &GroupedArray, ctx: &mut ExecutionCtx, ) -> VortexResult<Option<ArrayRef>>

Aggregate each group in the provided grouped array and return an array of the aggregate states.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§