You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ag...@apache.org on 2022/11/17 15:17:54 UTC

[arrow-datafusion] branch master updated: Minor: remove unecessary clone() in planner (#4249)

This is an automated email from the ASF dual-hosted git repository.

agrove pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-datafusion.git


The following commit(s) were added to refs/heads/master by this push:
     new 6f62870e6 Minor: remove unecessary clone() in planner (#4249)
6f62870e6 is described below

commit 6f62870e6e640c4a3f486fbe9bdf49b30c0b5c34
Author: Andrew Lamb <an...@nerdnetworks.org>
AuthorDate: Thu Nov 17 10:17:48 2022 -0500

    Minor: remove unecessary clone() in planner (#4249)
---
 datafusion/sql/src/planner.rs | 26 +++++++++++---------------
 1 file changed, 11 insertions(+), 15 deletions(-)

diff --git a/datafusion/sql/src/planner.rs b/datafusion/sql/src/planner.rs
index f3cd1674d..227025773 100644
--- a/datafusion/sql/src/planner.rs
+++ b/datafusion/sql/src/planner.rs
@@ -2319,11 +2319,11 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
             SQLExpr::Nested(e) => self.sql_expr_to_logical_expr(*e, schema, ctes),
 
-            SQLExpr::Exists { subquery, negated } => self.parse_exists_subquery(&subquery, negated, schema, ctes),
+            SQLExpr::Exists { subquery, negated } => self.parse_exists_subquery(*subquery, negated, schema, ctes),
 
-            SQLExpr::InSubquery { expr, subquery, negated } => self.parse_in_subquery(&expr, &subquery, negated, schema, ctes),
+            SQLExpr::InSubquery { expr, subquery, negated } => self.parse_in_subquery(*expr, *subquery, negated, schema, ctes),
 
-            SQLExpr::Subquery(subquery) => self.parse_scalar_subquery(&subquery, schema, ctes),
+            SQLExpr::Subquery(subquery) => self.parse_scalar_subquery(*subquery, schema, ctes),
 
             SQLExpr::ArrayAgg(array_agg) => self.parse_array_agg(array_agg, schema, ctes),
 
@@ -2336,7 +2336,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
     fn parse_exists_subquery(
         &self,
-        subquery: &Query,
+        subquery: Query,
         negated: bool,
         input_schema: &DFSchema,
         ctes: &mut HashMap<String, LogicalPlan>,
@@ -2344,7 +2344,7 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
         Ok(Expr::Exists {
             subquery: Subquery {
                 subquery: Arc::new(self.subquery_to_plan(
-                    subquery.clone(),
+                    subquery,
                     ctes,
                     input_schema,
                 )?),
@@ -2355,17 +2355,17 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
     fn parse_in_subquery(
         &self,
-        expr: &SQLExpr,
-        subquery: &Query,
+        expr: SQLExpr,
+        subquery: Query,
         negated: bool,
         input_schema: &DFSchema,
         ctes: &mut HashMap<String, LogicalPlan>,
     ) -> Result<Expr> {
         Ok(Expr::InSubquery {
-            expr: Box::new(self.sql_to_rex(expr.clone(), input_schema, ctes)?),
+            expr: Box::new(self.sql_to_rex(expr, input_schema, ctes)?),
             subquery: Subquery {
                 subquery: Arc::new(self.subquery_to_plan(
-                    subquery.clone(),
+                    subquery,
                     ctes,
                     input_schema,
                 )?),
@@ -2376,16 +2376,12 @@ impl<'a, S: ContextProvider> SqlToRel<'a, S> {
 
     fn parse_scalar_subquery(
         &self,
-        subquery: &Query,
+        subquery: Query,
         input_schema: &DFSchema,
         ctes: &mut HashMap<String, LogicalPlan>,
     ) -> Result<Expr> {
         Ok(Expr::ScalarSubquery(Subquery {
-            subquery: Arc::new(self.subquery_to_plan(
-                subquery.clone(),
-                ctes,
-                input_schema,
-            )?),
+            subquery: Arc::new(self.subquery_to_plan(subquery, ctes, input_schema)?),
         }))
     }