Skip to content

Commit

Permalink
fix: from_plan generate Agg can be with different schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackwener committed Jul 1, 2023
1 parent ea71acf commit 57bc522
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions datafusion/expr/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,14 +827,13 @@ pub fn from_plan(
window_expr: expr[0..window_expr.len()].to_vec(),
schema: schema.clone(),
})),
LogicalPlan::Aggregate(Aggregate {
group_expr, schema, ..
}) => Ok(LogicalPlan::Aggregate(Aggregate::try_new_with_schema(
Arc::new(inputs[0].clone()),
expr[0..group_expr.len()].to_vec(),
expr[group_expr.len()..].to_vec(),
schema.clone(),
)?)),
LogicalPlan::Aggregate(Aggregate { group_expr, .. }) => {
Ok(LogicalPlan::Aggregate(Aggregate::try_new(
Arc::new(inputs[0].clone()),
expr[0..group_expr.len()].to_vec(),
expr[group_expr.len()..].to_vec(),
)?))
}
LogicalPlan::Sort(SortPlan { fetch, .. }) => Ok(LogicalPlan::Sort(SortPlan {
expr: expr.to_vec(),
input: Arc::new(inputs[0].clone()),
Expand Down

0 comments on commit 57bc522

Please sign in to comment.