You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2024/03/07 21:13:13 UTC
Re: [I] Generate an Expr from string [arrow-datafusion]
alamb commented on issue #8736:
URL: https://github.com/apache/arrow-datafusion/issues/8736#issuecomment-1984495896
I think you can do this today via [`SqlToRel::sql_to_expr`](https://docs.rs/datafusion/latest/datafusion/sql/planner/struct.SqlToRel.html#method.sql_to_expr)
## Step 1: Add an example to show how to use `SqlToRel::sql_to_expr`
So add an example (perhaps `expr_to_sql.rs`) in
https://github.com/apache/arrow-datafusion/tree/main/datafusion-examples/examples that showed how to call `SqlToRel` to parser the expression above
## Step 2: Add an API to DataFusion that made parsing SQL easier
The idea is to avoid requiring PlannerContext, a `DFSchema`, etc).
For example:
```rust
let expr: Expr = parse_expr("c < 5")?;
```
Note this doesn't provide a schema.
--
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@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org