Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Weijun-H committed Nov 29, 2023
1 parent e0e625c commit cf75c3e
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions datafusion/core/src/physical_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,34 @@ fn create_physical_name(e: &Expr, is_first_expr: bool) -> Result<String> {
func_def,
distinct,
args,
..
}) => create_function_physical_name(func_def.name(), *distinct, args),
filter,
order_by,
}) => match func_def {
AggregateFunctionDefinition::BuiltIn { fun: _, name: _ } => {
create_function_physical_name(func_def.name(), *distinct, args)
}
AggregateFunctionDefinition::UDF(fun) => {
// TODO: Add support for filter and order by in AggregateUDF
if filter.is_some() {
return exec_err!(
"aggregate expression with filter is not supported"
);
}
if order_by.is_some() {
return exec_err!(
"aggregate expression with order_by is not supported"
);
}
let mut names = Vec::with_capacity(args.len());
for e in args {
names.push(create_physical_name(e, false)?);
}
Ok(format!("{}({})", fun.name(), names.join(",")))
}
AggregateFunctionDefinition::Name(_) => {
internal_err!("Aggregate function `Expr` with name should be resolved.")
}
},
Expr::GroupingSet(grouping_set) => match grouping_set {
GroupingSet::Rollup(exprs) => Ok(format!(
"ROLLUP ({})",
Expand Down

0 comments on commit cf75c3e

Please sign in to comment.