Skip to content

Commit 3224f44

Browse files
committed
revert: from_plan keep same schema Agg/Window in #6820
1 parent a08ea21 commit 3224f44

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

datafusion/expr/src/utils.rs

+17-13
Original file line numberDiff line numberDiff line change
@@ -821,19 +821,23 @@ pub fn from_plan(
821821
input: Arc::new(inputs[0].clone()),
822822
})),
823823
},
824-
LogicalPlan::Window(Window { window_expr, .. }) => {
825-
Ok(LogicalPlan::Window(Window::try_new(
826-
expr[0..window_expr.len()].to_vec(),
827-
Arc::new(inputs[0].clone()),
828-
)?))
829-
}
830-
LogicalPlan::Aggregate(Aggregate { group_expr, .. }) => {
831-
Ok(LogicalPlan::Aggregate(Aggregate::try_new(
832-
Arc::new(inputs[0].clone()),
833-
expr[0..group_expr.len()].to_vec(),
834-
expr[group_expr.len()..].to_vec(),
835-
)?))
836-
}
824+
LogicalPlan::Window(Window {
825+
window_expr,
826+
schema,
827+
..
828+
}) => Ok(LogicalPlan::Window(Window {
829+
input: Arc::new(inputs[0].clone()),
830+
window_expr: expr[0..window_expr.len()].to_vec(),
831+
schema: schema.clone(),
832+
})),
833+
LogicalPlan::Aggregate(Aggregate {
834+
group_expr, schema, ..
835+
}) => Ok(LogicalPlan::Aggregate(Aggregate::try_new_with_schema(
836+
Arc::new(inputs[0].clone()),
837+
expr[0..group_expr.len()].to_vec(),
838+
expr[group_expr.len()..].to_vec(),
839+
schema.clone(),
840+
)?)),
837841
LogicalPlan::Sort(SortPlan { fetch, .. }) => Ok(LogicalPlan::Sort(SortPlan {
838842
expr: expr.to_vec(),
839843
input: Arc::new(inputs[0].clone()),

0 commit comments

Comments
 (0)