Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions vortex-array/public-api.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,54 @@ pub mod vortex_array::aggregate_fn

pub mod vortex_array::aggregate_fn::fns

pub mod vortex_array::aggregate_fn::fns::count

pub struct vortex_array::aggregate_fn::fns::count::Count

impl core::clone::Clone for vortex_array::aggregate_fn::fns::count::Count

pub fn vortex_array::aggregate_fn::fns::count::Count::clone(&self) -> vortex_array::aggregate_fn::fns::count::Count

impl core::fmt::Debug for vortex_array::aggregate_fn::fns::count::Count

pub fn vortex_array::aggregate_fn::fns::count::Count::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::count::Count

pub type vortex_array::aggregate_fn::fns::count::Count::Options = vortex_array::aggregate_fn::EmptyOptions

pub type vortex_array::aggregate_fn::fns::count::Count::Partial = u64

pub fn vortex_array::aggregate_fn::fns::count::Count::accumulate(&self, _partial: &mut Self::Partial, _batch: &vortex_array::Columnar, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()>

pub fn vortex_array::aggregate_fn::fns::count::Count::coerce_args(&self, options: &Self::Options, input_dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<vortex_array::dtype::DType>

pub fn vortex_array::aggregate_fn::fns::count::Count::combine_partials(&self, partial: &mut Self::Partial, other: vortex_array::scalar::Scalar) -> vortex_error::VortexResult<()>

pub fn vortex_array::aggregate_fn::fns::count::Count::deserialize(&self, _metadata: &[u8], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Options>

pub fn vortex_array::aggregate_fn::fns::count::Count::empty_partial(&self, _options: &Self::Options, _input_dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<Self::Partial>

pub fn vortex_array::aggregate_fn::fns::count::Count::finalize(&self, partials: vortex_array::ArrayRef) -> vortex_error::VortexResult<vortex_array::ArrayRef>

pub fn vortex_array::aggregate_fn::fns::count::Count::finalize_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::count::Count::id(&self) -> vortex_array::aggregate_fn::AggregateFnId

pub fn vortex_array::aggregate_fn::fns::count::Count::is_saturated(&self, _partial: &Self::Partial) -> bool

pub fn vortex_array::aggregate_fn::fns::count::Count::partial_dtype(&self, options: &Self::Options, input_dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::dtype::DType>

pub fn vortex_array::aggregate_fn::fns::count::Count::reset(&self, partial: &mut Self::Partial)

pub fn vortex_array::aggregate_fn::fns::count::Count::return_dtype(&self, _options: &Self::Options, _input_dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::dtype::DType>

pub fn vortex_array::aggregate_fn::fns::count::Count::serialize(&self, _options: &Self::Options) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>

pub fn vortex_array::aggregate_fn::fns::count::Count::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::count::Count::try_accumulate(&self, state: &mut Self::Partial, batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub mod vortex_array::aggregate_fn::fns::is_constant

pub mod vortex_array::aggregate_fn::fns::is_constant::primitive
Expand Down Expand Up @@ -86,6 +134,8 @@ pub fn vortex_array::aggregate_fn::fns::is_constant::IsConstant::serialize(&self

pub fn vortex_array::aggregate_fn::fns::is_constant::IsConstant::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::is_constant::IsConstant::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub struct vortex_array::aggregate_fn::fns::is_constant::IsConstantPartial

pub fn vortex_array::aggregate_fn::fns::is_constant::is_constant(array: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>
Expand Down Expand Up @@ -142,6 +192,8 @@ pub fn vortex_array::aggregate_fn::fns::is_sorted::IsSorted::serialize(&self, op

pub fn vortex_array::aggregate_fn::fns::is_sorted::IsSorted::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::is_sorted::IsSorted::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub struct vortex_array::aggregate_fn::fns::is_sorted::IsSortedOptions

pub vortex_array::aggregate_fn::fns::is_sorted::IsSortedOptions::strict: bool
Expand Down Expand Up @@ -232,6 +284,8 @@ pub fn vortex_array::aggregate_fn::fns::min_max::MinMax::serialize(&self, _optio

pub fn vortex_array::aggregate_fn::fns::min_max::MinMax::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::min_max::MinMax::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub struct vortex_array::aggregate_fn::fns::min_max::MinMaxPartial

pub struct vortex_array::aggregate_fn::fns::min_max::MinMaxResult
Expand Down Expand Up @@ -310,6 +364,8 @@ pub fn vortex_array::aggregate_fn::fns::nan_count::NanCount::serialize(&self, _o

pub fn vortex_array::aggregate_fn::fns::nan_count::NanCount::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::nan_count::NanCount::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub fn vortex_array::aggregate_fn::fns::nan_count::nan_count(array: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<usize>

pub mod vortex_array::aggregate_fn::fns::sum
Expand Down Expand Up @@ -372,6 +428,8 @@ pub fn vortex_array::aggregate_fn::fns::sum::Sum::serialize(&self, _options: &Se

pub fn vortex_array::aggregate_fn::fns::sum::Sum::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::sum::Sum::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub struct vortex_array::aggregate_fn::fns::sum::SumPartial

pub fn vortex_array::aggregate_fn::fns::sum::sum(array: &vortex_array::ArrayRef, ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>
Expand Down Expand Up @@ -616,6 +674,44 @@ pub fn vortex_array::aggregate_fn::AggregateFnVTable::serialize(&self, options:

pub fn vortex_array::aggregate_fn::AggregateFnVTable::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::AggregateFnVTable::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::count::Count

pub type vortex_array::aggregate_fn::fns::count::Count::Options = vortex_array::aggregate_fn::EmptyOptions

pub type vortex_array::aggregate_fn::fns::count::Count::Partial = u64

pub fn vortex_array::aggregate_fn::fns::count::Count::accumulate(&self, _partial: &mut Self::Partial, _batch: &vortex_array::Columnar, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<()>

pub fn vortex_array::aggregate_fn::fns::count::Count::coerce_args(&self, options: &Self::Options, input_dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<vortex_array::dtype::DType>

pub fn vortex_array::aggregate_fn::fns::count::Count::combine_partials(&self, partial: &mut Self::Partial, other: vortex_array::scalar::Scalar) -> vortex_error::VortexResult<()>

pub fn vortex_array::aggregate_fn::fns::count::Count::deserialize(&self, _metadata: &[u8], _session: &vortex_session::VortexSession) -> vortex_error::VortexResult<Self::Options>

pub fn vortex_array::aggregate_fn::fns::count::Count::empty_partial(&self, _options: &Self::Options, _input_dtype: &vortex_array::dtype::DType) -> vortex_error::VortexResult<Self::Partial>

pub fn vortex_array::aggregate_fn::fns::count::Count::finalize(&self, partials: vortex_array::ArrayRef) -> vortex_error::VortexResult<vortex_array::ArrayRef>

pub fn vortex_array::aggregate_fn::fns::count::Count::finalize_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::count::Count::id(&self) -> vortex_array::aggregate_fn::AggregateFnId

pub fn vortex_array::aggregate_fn::fns::count::Count::is_saturated(&self, _partial: &Self::Partial) -> bool

pub fn vortex_array::aggregate_fn::fns::count::Count::partial_dtype(&self, options: &Self::Options, input_dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::dtype::DType>

pub fn vortex_array::aggregate_fn::fns::count::Count::reset(&self, partial: &mut Self::Partial)

pub fn vortex_array::aggregate_fn::fns::count::Count::return_dtype(&self, _options: &Self::Options, _input_dtype: &vortex_array::dtype::DType) -> core::option::Option<vortex_array::dtype::DType>

pub fn vortex_array::aggregate_fn::fns::count::Count::serialize(&self, _options: &Self::Options) -> vortex_error::VortexResult<core::option::Option<alloc::vec::Vec<u8>>>

pub fn vortex_array::aggregate_fn::fns::count::Count::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::count::Count::try_accumulate(&self, state: &mut Self::Partial, batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::is_constant::IsConstant

pub type vortex_array::aggregate_fn::fns::is_constant::IsConstant::Options = vortex_array::aggregate_fn::EmptyOptions
Expand Down Expand Up @@ -650,6 +746,8 @@ pub fn vortex_array::aggregate_fn::fns::is_constant::IsConstant::serialize(&self

pub fn vortex_array::aggregate_fn::fns::is_constant::IsConstant::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::is_constant::IsConstant::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::is_sorted::IsSorted

pub type vortex_array::aggregate_fn::fns::is_sorted::IsSorted::Options = vortex_array::aggregate_fn::fns::is_sorted::IsSortedOptions
Expand Down Expand Up @@ -684,6 +782,8 @@ pub fn vortex_array::aggregate_fn::fns::is_sorted::IsSorted::serialize(&self, op

pub fn vortex_array::aggregate_fn::fns::is_sorted::IsSorted::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::is_sorted::IsSorted::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::min_max::MinMax

pub type vortex_array::aggregate_fn::fns::min_max::MinMax::Options = vortex_array::aggregate_fn::EmptyOptions
Expand Down Expand Up @@ -718,6 +818,8 @@ pub fn vortex_array::aggregate_fn::fns::min_max::MinMax::serialize(&self, _optio

pub fn vortex_array::aggregate_fn::fns::min_max::MinMax::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::min_max::MinMax::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::nan_count::NanCount

pub type vortex_array::aggregate_fn::fns::nan_count::NanCount::Options = vortex_array::aggregate_fn::EmptyOptions
Expand Down Expand Up @@ -752,6 +854,8 @@ pub fn vortex_array::aggregate_fn::fns::nan_count::NanCount::serialize(&self, _o

pub fn vortex_array::aggregate_fn::fns::nan_count::NanCount::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::nan_count::NanCount::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

impl vortex_array::aggregate_fn::AggregateFnVTable for vortex_array::aggregate_fn::fns::sum::Sum

pub type vortex_array::aggregate_fn::fns::sum::Sum::Options = vortex_array::aggregate_fn::EmptyOptions
Expand Down Expand Up @@ -786,6 +890,8 @@ pub fn vortex_array::aggregate_fn::fns::sum::Sum::serialize(&self, _options: &Se

pub fn vortex_array::aggregate_fn::fns::sum::Sum::to_scalar(&self, partial: &Self::Partial) -> vortex_error::VortexResult<vortex_array::scalar::Scalar>

pub fn vortex_array::aggregate_fn::fns::sum::Sum::try_accumulate(&self, _state: &mut Self::Partial, _batch: &vortex_array::ArrayRef, _ctx: &mut vortex_array::ExecutionCtx) -> vortex_error::VortexResult<bool>

pub trait vortex_array::aggregate_fn::AggregateFnVTableExt: vortex_array::aggregate_fn::AggregateFnVTable

pub fn vortex_array::aggregate_fn::AggregateFnVTableExt::bind(&self, options: Self::Options) -> vortex_array::aggregate_fn::AggregateFnRef
Expand Down
5 changes: 5 additions & 0 deletions vortex-array/src/aggregate_fn/accumulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ impl<V: AggregateFnVTable> DynAccumulator for Accumulator<V> {
batch.dtype()
);

// Allow the vtable to short-circuit on the raw array before decompression.
if self.vtable.try_accumulate(&mut self.partial, batch, ctx)? {
return Ok(());
}

let session = ctx.session().clone();
let kernels = &session.aggregate_fns().kernels;

Expand Down
2 changes: 1 addition & 1 deletion vortex-array/src/aggregate_fn/accumulator_grouped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl<V: AggregateFnVTable> GroupedAccumulator<V> {
if validity.value(offset) {
let group = elements.slice(offset..offset + size)?;
accumulator.accumulate(&group, ctx)?;
states.append_scalar(&accumulator.finish()?)?;
states.append_scalar(&accumulator.flush()?)?;
} else {
states.append_null()
}
Expand Down
Loading
Loading