Skip to content

AggregateFnProperties #7843

@gatesn

Description

@gatesn
pub struct AggregateFnProperties {
    pub order_sensitivity: AggregateOrderSensitivity,
    pub partial_aggregation: PartialAggregation,
    pub distinct_sensitivity: DistinctSensitivity,
}

pub enum AggregateOrderSensitivity {
    Insensitive, // planner may reorder input rows
    Sensitive,   // input order is part of the result
}

pub enum PartialAggregation {
    Unsupported,  // do not introduce partial/final aggregation
    OrderedMerge, // may split contiguous input, must merge partials in input order
    UnorderedMerge, // may split/repartition and merge partials in any order/tree
}

pub enum DistinctSensitivity {
    Sensitive,
    Insensitive, // agg(DISTINCT x) == agg(x)
}

trait AggregateFnVTable {
  ...
  fn properties(&self, options: &Self::Options, input_dtype: &DType) -> AggregateFnProperties;
}
Aggregate Properties
count, nan_count order-insensitive, unordered-merge
min_max order-insensitive, unordered-merge, distinct-insensitive
is_constant likely order-insensitive, unordered-merge
first, last, is_sorted order-sensitive, ordered-merge
sum(bool), sum(unsigned) order-insensitive, unordered-merge
sum(signed), sum(decimal), sum(float) order-sensitive, partial aggregation unsupported under strict Vortex semantics
mean inherits sum’s dtype caveats

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions