diff --git a/core/src/execution/datafusion/planner.rs b/core/src/execution/datafusion/planner.rs index 7a37e3aae..a0b75de3f 100644 --- a/core/src/execution/datafusion/planner.rs +++ b/core/src/execution/datafusion/planner.rs @@ -779,7 +779,7 @@ impl PhysicalPlanner { .iter() .enumerate() .map(|(idx, expr)| { - self.create_expr(expr, child.schema()) + self.create_expr(expr, aggregate.schema()) .map(|r| (r, format!("col_{}", idx))) }) .collect();