oersted opened a new issue, #4890:
URL: https://github.com/apache/arrow-datafusion/issues/4890

   **Is your feature request related to a problem or challenge? Please describe 
what you are trying to do.**
   
   I'd say that, for instance, `.select(["name"])` is significantly easier to 
read and write than `.select(vec![col("name")])`.
   
   **Describe the solution you'd like**
   
   Polars deals with this by having the following more generic signature.
   
   ```
   pub fn select<I, S>(&self, selection: I) -> Result<DataFrame, PolarsError>
   where
       I: IntoIterator<Item = S>,
       S: AsRef<str>
   ```
   
   `IntoIterator` makes a lot of sense, it allows for arrays for concise syntax 
and Vec or any other collection whenever the list is programmatically generated.
   
   `AsRef<str>` is less clear, I'm not sure how they refer to complex 
expressions with a string reference. Perhaps `Into<Expr>` might be better with 
a default implementation for `&str`.
   
   Yes I know that there's also a `select_columns(&self, columns: &[&str])` 
method in the current API, but it is still less flexible, somewhat redundant, 
and there are other places where `vec!` and `col()` somewhat pollute the syntax 
still.


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

Reply via email to