alamb commented on code in PR #18415:
URL: https://github.com/apache/datafusion/pull/18415#discussion_r2482493456


##########
datafusion/expr/src/expr_schema.rs:
##########
@@ -429,38 +430,36 @@ impl ExprSchemable for Expr {
         schema: &dyn ExprSchema,
     ) -> Result<(Option<TableReference>, Arc<Field>)> {
         let (relation, schema_name) = self.qualified_name();
-        #[allow(deprecated)]
+        #[expect(deprecated)]
         let field = match self {
             Expr::Alias(Alias {
                 expr,
                 name: _,
                 metadata,
                 ..
             }) => {
-                let field = expr.to_field(schema).map(|(_, f)| 
f.as_ref().clone())?;

Review Comment:
   these `as_ref().clone()` type methods are doing a deep clone on the Fields 
each time even when the name is not changing



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to