alamb commented on a change in pull request #9692: URL: https://github.com/apache/arrow/pull/9692#discussion_r593746439
########## File path: rust/datafusion/src/logical_plan/builder.rs ########## @@ -132,16 +132,19 @@ impl LogicalPlanBuilder { /// This function errors under any of the following conditions: /// * Two or more expressions have the same name /// * An invalid expression is used (e.g. a `sort` expression) - pub fn project(&self, expr: &[Expr]) -> Result<Self> { + pub fn project(&self, expr: Vec<Expr>) -> Result<Self> { let input_schema = self.plan.schema(); let mut projected_expr = vec![]; - (0..expr.len()).for_each(|i| match &expr[i] { - Expr::Wildcard => { - (0..input_schema.fields().len()) - .for_each(|i| projected_expr.push(col(input_schema.field(i).name()))); - } - _ => projected_expr.push(expr[i].clone()), Review comment: Here is where the `Expr::clone` occurs and no longer does after the changes contemplated in this PR ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org