-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Handle alias when parsing sql(parse_sql_expr) #12939
base: main
Are you sure you want to change the base?
Conversation
This PR duplicates some of the function that return Expr(sqlparser) and add _with_alias to their name(change return type to However, I thinks the duplication is unneeded for function that return Expr(datafusion), because datafusion already have Alias entry in Expr enum. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Eason0729 !
I looked at #12518
Could you possible add a test showing the usecase from that issue working?
For example a test that does something like:
df.parse_sql_expr("SUM(int_col) as sum_int_col")
FYI @milenkovicm |
Sure, I will work on that next week. |
Marking as draft as I think this PR is no longer waiting on feedback. Please mark it as ready for review when it is ready for another look |
Which issue does this PR close?
Close #12518
Also, we need to wait for next
sqlparser
release, so this PR is expected to be draft for a while.Rationale for this change
What changes are included in this PR?
add
sql_expr_to_logical_expr_with_alias
andparse_sql_into_dialect_with_alias
function, whose returns contain alias if there is alias.Are these changes tested?
Are there any user-facing changes?