Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose and document a simpler public API for simplify expressions #3709

Closed
alamb opened this issue Oct 4, 2022 · 0 comments · Fixed by #3719
Closed

Expose and document a simpler public API for simplify expressions #3709

alamb opened this issue Oct 4, 2022 · 0 comments · Fixed by #3719
Labels
enhancement New feature or request

Comments

@alamb
Copy link
Contributor

alamb commented Oct 4, 2022

Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Similarly to #3708,

We programmatically create Exprs and would like to take advantage of the simplify + const evaluation code.

In IOx we have a SimplifyAdapter that does this https://github.com/influxdata/influxdb_iox/blob/alamb%2Fmass_upgrade/predicate/src/rpc_predicate.rs#L279 but it would be better to get this API more visible

Describe the solution you'd like
I think I would like a interface like:

/// Apply simplification and constant propagation to `expr` 
/// for example `X + (1 + 3)` is rewritten to `X + 4`
pub fn simplify_expr(expr: Expr, schema: &DfSchema, props: &ExecutionProps) -> Result<Expr> {
...
}

Describe alternatives you've considered
Can keep doing SimplifyAdapter type

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant