alamb commented on code in PR #6820:
URL: https://github.com/apache/arrow-datafusion/pull/6820#discussion_r1249444819


##########
datafusion/expr/src/utils.rs:
##########
@@ -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, .. }) => {

Review Comment:
   I don't understand when this change would result in a different plan (the 
schema should always be unchanged if the same expressions are used)
   
   Is this a change to make the code more defensive, or do you think it is 
causing a problem?
   
   Related, perhaps we should remove `Aggregate::try_new_with_schema` as well 
(to force the recalculation / validation of the output schema)?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to