Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
Signed-off-by: jayzhan211 <jayzhan211@gmail.com>
  • Loading branch information
jayzhan211 committed Mar 7, 2024
1 parent 3185f9f commit 3ecc772
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions datafusion/core/src/physical_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ fn create_physical_name(e: &Expr, is_first_expr: bool) -> Result<String> {
args,
filter,
order_by,
null_treatment: _,
}) => match func_def {
AggregateFunctionDefinition::BuiltIn(..) => {
create_function_physical_name(func_def.name(), *distinct, args)
Expand Down Expand Up @@ -1674,7 +1675,7 @@ pub fn create_aggregate_expr_with_name_and_maybe_filter(
};

let sort_exprs = order_by.clone().unwrap_or(vec![]);
let phy_order_by = match order_by {
let order_by = match order_by {
Some(e) => Some(
e.iter()
.map(|expr| {
Expand All @@ -1693,7 +1694,7 @@ pub fn create_aggregate_expr_with_name_and_maybe_filter(
== NullTreatment::IgnoreNulls;
let (agg_expr, filter, order_by) = match func_def {
AggregateFunctionDefinition::BuiltIn(fun) => {
let ordering_reqs = phy_order_by.clone().unwrap_or(vec![]);
let ordering_reqs = order_by.clone().unwrap_or(vec![]);
let agg_expr = aggregates::create_aggregate_expr(
fun,
*distinct,
Expand All @@ -1703,11 +1704,11 @@ pub fn create_aggregate_expr_with_name_and_maybe_filter(
name,
ignore_nulls,
)?;
(agg_expr, filter, phy_order_by)
(agg_expr, filter, order_by)
}
AggregateFunctionDefinition::UDF(fun) => {
let ordering_reqs: Vec<PhysicalSortExpr> =
phy_order_by.clone().unwrap_or(vec![]);
order_by.clone().unwrap_or(vec![]);

let agg_expr = udaf::create_aggregate_expr(
fun,
Expand All @@ -1717,15 +1718,15 @@ pub fn create_aggregate_expr_with_name_and_maybe_filter(
physical_input_schema,
name,
)?;
(agg_expr, filter, phy_order_by)
(agg_expr, filter, order_by)
}
AggregateFunctionDefinition::Name(_) => {
return internal_err!(
"Aggregate function name should have been resolved"
)
}
};
Ok((agg_expr, filter, phy_order_by))
Ok((agg_expr, filter, order_by))
}
other => internal_err!("Invalid aggregate expression '{other:?}'"),
}
Expand Down

0 comments on commit 3ecc772

Please sign in to comment.