diff --git a/datafusion/functions-aggregate/src/first_last.rs b/datafusion/functions-aggregate/src/first_last.rs index a69ac1ff71cb..688da7b8b60e 100644 --- a/datafusion/functions-aggregate/src/first_last.rs +++ b/datafusion/functions-aggregate/src/first_last.rs @@ -33,8 +33,8 @@ use datafusion_expr::function::{AccumulatorArgs, StateFieldsArgs}; use datafusion_expr::type_coercion::aggregates::NUMERICS; use datafusion_expr::utils::{format_state_name, AggregateOrderSensitivity}; use datafusion_expr::{ - Accumulator, AggregateUDFImpl, ArrayFunctionSignature, Signature, TypeSignature, - Volatility, + Accumulator, AggregateUDFImpl, ArrayFunctionSignature, Expr, Signature, + TypeSignature, Volatility, }; use datafusion_physical_expr_common::aggregate::utils::get_sort_options; use datafusion_physical_expr_common::sort_expr::{ diff --git a/datafusion/optimizer/src/replace_distinct_aggregate.rs b/datafusion/optimizer/src/replace_distinct_aggregate.rs index c232935f9e23..a4fe160a1b36 100644 --- a/datafusion/optimizer/src/replace_distinct_aggregate.rs +++ b/datafusion/optimizer/src/replace_distinct_aggregate.rs @@ -97,7 +97,7 @@ impl OptimizerRule for ReplaceDistinctWithAggregate { // Construct the aggregation expression to be used to fetch the selected expressions. let aggr_expr = select_expr .into_iter() - .map(|e| first_value(vec![e], false, None, sort_expr.clone(), None)); + .map(|e| first_value(e, sort_expr.clone())); let aggr_expr = normalize_cols(aggr_expr, input.as_ref())?; let group_expr = normalize_cols(on_expr, input.as_ref())?;