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


##########
datafusion/expr/src/logical_plan/builder.rs:
##########
@@ -1229,6 +1223,7 @@ pub fn project(
     plan: LogicalPlan,
     expr: impl IntoIterator<Item = impl Into<Expr>>,
 ) -> Result<LogicalPlan> {
+    // TODO: move it into analyzer

Review Comment:
   👍 



##########
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:
   Ah, yes, this makes sense now -- `new_with_plan` provide new (potentially 
different) exprs and inputs. Makes sense 👍 



##########
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:
   Ah, yes, this makes sense now -- `new_with_plan` provides new (potentially 
different) exprs and inputs. Makes sense 👍 



-- 
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