-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Convert Expr to a parsable representation #7165
Comments
I made a PR #6708 about printing |
Thanks @parkma99 On delta-rs we this method to convert an sql expression to I would like to have a function like |
cc @alamb. Do we need a new function to |
We could potentially propose changing canonical_name - however as I recall that function is used to create the column names so it might have a large change. Another possibility, which is somewhat of a hack, might be to add a expr rewrite pass parsing stuff like |
just like does?? |
That is a good example of using the rewriter ! Though the actual rewrite rule is a little different |
Is your feature request related to a problem or challenge?
In the delta-rs project we support operations such as delete, update, and merge where users can supply predicate as either a string or a DataFusion
Expr
. String predicates go through sql-parser to obtain anExpr
and are evaluated. At the end of each operation the expression must be converted back to a string to store in the transaction log for conflict resolution.The implementations for
create_name
andcanonical_name
almost fit this need but scalar values are surrounded by their type which cannot be parsed by sql-parser.E.G
col1 = 1
becomescol1 = Int32(1)
Describe the solution you'd like
Given an
Expr
one should be able to obtain it's string representation that can be parsed by sql parser.Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: