You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "milenkovicm (via GitHub)" <gi...@apache.org> on 2024/09/18 09:46:13 UTC
[I] DataFrame select_expr [datafusion]
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-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] DataFrame select_exprs [datafusion]
Posted by "comphead (via GitHub)" <gi...@apache.org>.
comphead closed issue #12519: DataFrame select_exprs
URL: https://github.com/apache/datafusion/issues/12519
--
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-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org