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

   ### Is your feature request related to a problem or challenge?
   
   `DataFrame` exposes `select_columns` and `select` methods. The first of 
which expects list of columns to be selected, later one expects list of 
expressions created using logical expression API , which is straight forward 
but still needs some effort. 
   
   
   ### Describe the solution you'd like
   
   With `parse_sql_expr` available, it may make sense to provide `select_expr` 
which would accept list of expressions as strings, and convert them to actual 
logical expressions.
   
   Something similar to: 
   
   ```rust
   pub fn select_expr(self, exprs: &[&str]) -> Result<DataFrame> {
           let expr_list = exprs
               .iter()
               .map(|e| self.parse_sql_expr(e))
               .collect::<Result<Vec<_>>>()?;
   
           self.select(expr_list)
   }
   ```
   
   This would be equivalent to spark dataframe `selectExp`  
https://spark.apache.org/docs/3.4.2/api/python/reference/pyspark.sql/api/pyspark.sql.DataFrame.selectExpr.html
   
   ### Describe alternatives you've considered
   
   _No response_
   
   ### Additional context
   
   https://github.com/apache/datafusion/issues/12518 looks like there is issue 
with `parse_sql_expr` and alias handling 


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