alamb opened a new issue, #13202:
URL: https://github.com/apache/datafusion/issues/13202

   ### Is your feature request related to a problem or challenge?
   
   In our code / optimizers we have a lot of code that looks like this when we 
are
   trying to rewrite a SortExec node by making a copy and changing only some of 
the
   fields. For example:
   
   
   ```rust
        new_plan = Ok(Arc::new(
                   SortExec::new(sort_exec.expr().to_vec(), 
Arc::clone(sort_exec.input()))
                       .with_fetch(sort_exec.fetch())
                       .with_preserve_partitioning(true),
               ));
   ```
   
   This is problematic and we have had bugs in the past when SortExec got a new 
field (like `fetch`)
   
   We would like to simply be able to make a copy and modify appropriately:
   
   ```rust
        new_plan = 
Ok(Arc::new(sort_exec.clone().with_preserve_partitioning(true)));
   ```
   
   Many ExecutionPlans like [`ParquetExec` already implement 
`Clone`](https://docs.rs/datafusion/latest/datafusion/datasource/physical_plan/parquet/struct.ParquetExec.html#impl-Clone-for-ParquetExec)
 so it is nice to
   make the rest consistent
   
   
   ### Describe the solution you'd like
   
   I would like to derive `Clone` for other plans
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   _No response_


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