Skip to content
Closed
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
13 changes: 7 additions & 6 deletions datafusion/functions-aggregate/src/array_agg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ use arrow::compute::{filter, SortOptions};
use arrow::datatypes::{DataType, Field, Fields};

use datafusion_common::cast::as_list_array;
use datafusion_common::utils::{get_row_at_idx, SingleRowListArrayBuilder};
use datafusion_common::{exec_err, ScalarValue};
use datafusion_common::{internal_err, Result};
use datafusion_common::scalar::copy_array_data;
use datafusion_common::utils::{
get_row_at_idx, take_function_args, SingleRowListArrayBuilder,
};
use datafusion_common::{exec_err, internal_err, Result, ScalarValue};
use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs};
use datafusion_expr::utils::format_state_name;
use datafusion_expr::{Accumulator, Signature, Volatility};
Expand Down Expand Up @@ -573,9 +575,8 @@ impl Accumulator for OrderSensitiveArrayAggAccumulator {
// inside `ARRAY_AGG` list, we will receive an `Array` that stores values
// received from its ordering requirement expression. (This information
// is necessary for during merging).
let [array_agg_values, agg_orderings, ..] = &states else {
return exec_err!("State should have two elements");
};
let [array_agg_values, agg_orderings] =
take_function_args("OrderSensitiveArrayAggAccumulator::merge_batch", states)?;
let Some(agg_orderings) = agg_orderings.as_list_opt::<i32>() else {
return exec_err!("Expects to receive a list array");
};
Expand Down
4 changes: 4 additions & 0 deletions datafusion/physical-plan/src/aggregates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ impl AggregateExec {
input_schema: SchemaRef,
schema: SchemaRef,
) -> Result<Self> {
dbg!(&aggr_expr);
dbg!(&group_by);
// Make sure arguments are consistent in size
if aggr_expr.len() != filter_expr.len() {
return internal_err!("Inconsistent aggregate expr: {:?} and filter expr: {:?} for AggregateExec, their size should match", aggr_expr, filter_expr);
Expand All @@ -469,6 +471,8 @@ impl AggregateExec {
.collect::<Vec<_>>(),
);

dbg!(input_eq_properties);

let req = get_finer_aggregate_exprs_requirement(
&mut aggr_expr,
&group_by,
Expand Down
Loading