You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/12/21 15:29:18 UTC

[GitHub] [arrow-datafusion] xudong963 commented on issue #1469: Convert `SqlToRel::statement_to_pan` to take ownership rather than references.

xudong963 commented on issue #1469:
URL: https://github.com/apache/arrow-datafusion/issues/1469#issuecomment-998872198


   @alamb  good catch!
   
   Here I give a specific example to omit clone
   ```rust
       pub fn external_table_to_plan(
           &self,
           statement: &CreateExternalTable,
       ) -> Result<LogicalPlan> {
           let CreateExternalTable {
               name,
               columns,
               file_type,
               has_header,
               location,
           } = statement;
   
           ...
   
           Ok(LogicalPlan::CreateExternalTable(PlanCreateExternalTable {
               schema: schema.to_dfschema_ref()?,
               name: name.clone(),
               location: location.clone(),
               file_type: *file_type,
               has_header: *has_header,
           }))
       }
   ```
   to
   
   ```rust
       pub fn external_table_to_plan(
           &self,
           statement: CreateExternalTable,
       ) -> Result<LogicalPlan> {
           let CreateExternalTable {
               name,
               columns,
               file_type,
               has_header,
               location,
           } = statement;
   
          ...
   
           Ok(LogicalPlan::CreateExternalTable(PlanCreateExternalTable {
               schema: schema.to_dfschema_ref()?,
               name,
               location,
               file_type: *file_type,
               has_header: *has_header,
           }))
       }
   ```
   
   BTW, I think it's better to add a `good first issue`


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org