Skip to content
Merged
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
9 changes: 7 additions & 2 deletions datafusion/core/tests/fuzz_cases/aggregate_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,12 @@ async fn run_aggregate_test(input1: Vec<RecordBatch>, group_by_columns: Vec<&str
schema.clone(),
)
.unwrap(),
) as Arc<dyn ExecutionPlan>;
);
assert_ne!(
aggregate_exec_running.input_order_mode(),
&InputOrderMode::Linear,
"running aggregate should observe ordered input for group_by: {group_by:?}"
);

let aggregate_exec_usual = Arc::new(
AggregateExec::try_new(
Expand All @@ -362,7 +367,7 @@ async fn run_aggregate_test(input1: Vec<RecordBatch>, group_by_columns: Vec<&str
schema.clone(),
)
.unwrap(),
) as Arc<dyn ExecutionPlan>;
);

let task_ctx = ctx.task_ctx();
let collected_usual = collect(aggregate_exec_usual.clone(), task_ctx.clone())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ pub(super) struct HashAggregateAccumulator {
accumulator: Box<dyn GroupsAccumulator>,
}

pub(super) type AggregateAccumulator = HashAggregateAccumulator;

/// Evaluated aggregate arguments and filter for one input batch.
///
/// For example, `AVG(x + 1) FILTER (WHERE x > 0)` evaluates both `x + 1`
Expand Down Expand Up @@ -348,7 +350,7 @@ impl MaterializedFinalOutput {
}

impl HashAggregateAccumulator {
fn new(
pub(super) fn new(
aggregate_expr: Arc<AggregateFunctionExpr>,
arguments: Vec<Arc<dyn PhysicalExpr>>,
filter: Option<Arc<dyn PhysicalExpr>>,
Expand Down Expand Up @@ -380,7 +382,10 @@ impl HashAggregateAccumulator {
/// and `x > 0`.
///
/// These arrays can be passed directly to [`GroupsAccumulator`] next.
fn evaluate_acc_args(&self, batch: &RecordBatch) -> Result<EvaluatedAccumulatorArgs> {
pub(super) fn evaluate_acc_args(
&self,
batch: &RecordBatch,
) -> Result<EvaluatedAccumulatorArgs> {
let arguments = self
.arguments
.iter()
Expand All @@ -403,6 +408,10 @@ impl HashAggregateAccumulator {
Ok(EvaluatedAccumulatorArgs { arguments, filter })
}

pub(super) fn size(&self) -> usize {
self.accumulator.size()
}

pub(super) fn update_batch(
&mut self,
values: &EvaluatedAccumulatorArgs,
Expand Down
Loading
Loading