Dandandan commented on pull request #9338:
URL: https://github.com/apache/arrow/pull/9338#issuecomment-771503315


   @alamb what do you think of an implementation like the following? I'll try 
to create a PR for this later this week.
    
   This would allow passing both an array (for simple contant cases like 
`sort([col("a")])`) and `Vecs`. For a `Vec`, `into()` is a no-op, for arrays it 
should be the same as using `vec![]`
   ```rust
       pub fn sort<T: Into<Vec<Expr>>>(&self, expr: T) -> Result<Self> {
           Ok(Self::from(&LogicalPlan::Sort {
               expr: expr.into(),
               input: Arc::new(self.plan.clone()),
           }))
       }
   
   ```
   
   Apart from this, `Self::from` currently does another clone on the logical 
plan, copying the expressions one more time. This could be changed by having it 
not accepting a `&LogicalPlan` but a `LogicalPlan`. 


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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to