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

   The `From` & `Into` conversion system is a very powerful and convenient 
feature of Rust.
   It should be used when there is only one obvious conversion from source type 
to the target.
   
   However, this appears not to be the case for some conversion into `Column`.
   Consider example
   
   ```rust
   let field: Field = ....;
   Expr::Column(field.name().into()))
   ```
   
   It seems to create an expression selecting given field. 
   It is also the simplest conversion from `Field` to `Expr::Column` because, 
`From<Field>` is not implemented.
   
   However, it doesn't do what it seems it does.
   The `From<&str> for Column` invokes name parser and lower-cases the field
   
   
   These conversions should be removed:
   
   ```rust
   impl From<&str> for Column {
       fn from(c: &str) -> Self {
           Self::from_qualified_name(c)
       }
   }
   
   /// Create a column, cloning the string
   impl From<&String> for Column {
       fn from(c: &String) -> Self {
           Self::from_qualified_name(c)
       }
   }
   
   /// Create a column, reusing the existing string
   impl From<String> for Column {
       fn from(c: String) -> Self {
           Self::from_qualified_name(c)
       }
   }
   ```
   
   Any usages should be replaced with explicit calls to 
`Column::from_qualified_name`.


-- 
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-unsubscr...@datafusion.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org
For additional commands, e-mail: github-h...@datafusion.apache.org

Reply via email to