This is an automated email from the ASF dual-hosted git repository.
jayzhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git
The following commit(s) were added to refs/heads/main by this push:
new 65ecfda84f Minor: Avoid a clone in ArrayFunctionRewriter (#10204)
65ecfda84f is described below
commit 65ecfda84f7a105412bbf4040885a1b1774668d1
Author: Andrew Lamb <[email protected]>
AuthorDate: Tue Apr 23 22:21:48 2024 -0400
Minor: Avoid a clone in ArrayFunctionRewriter (#10204)
---
datafusion/functions-array/src/rewrite.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/datafusion/functions-array/src/rewrite.rs
b/datafusion/functions-array/src/rewrite.rs
index d231dce4cb..32d15b5563 100644
--- a/datafusion/functions-array/src/rewrite.rs
+++ b/datafusion/functions-array/src/rewrite.rs
@@ -152,9 +152,8 @@ impl FunctionRewrite for ArrayFunctionRewriter {
expr,
field: GetFieldAccess::NamedStructField { name },
}) => {
- let expr = *expr.clone();
let name = Expr::Literal(name);
- Transformed::yes(get_field(expr, name.clone()))
+ Transformed::yes(get_field(*expr, name))
}
// expr[idx] ==> array_element(expr, idx)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]