-
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
Discussion: make it easier for specify SQL --> function translation #10534
Comments
@jayzhan211 asks #10374 (comment)
I personally think moving the translation of |
I rethought the issue in #10102, and I found it is strongly related to the idea of the user-defined parser mentioned here, that we can define the returned |
In general, I think the idea of allowing users to customize the behavior of the sql planner is reasonable. However I am not entirely sure if we need to modify the planner itself, or if it would be a better approach for users to implement rewrite passes after the existing planner runs 🤔 |
For anyone following along, @samuelcolvin @jayzhan211 and myself are discussing proposals for this API in |
#11180 -- looking very nice |
To rewrite with sql planner
|
I filed #11207 to track the work to move the remaining functions to the user defined extension planner so closing this one |
I extracted this from a conversation between @jayzhan211 and myself
Basically the usecase is that the sql planner converts things like
[1, 2, 3]
tomake_array(1, 2, 3)
and the namemake_array
is hard codedI agree that changing the parser to insert a call to get field access directly is a good idea (and would be consistent and allow us to remove
Expr::GetFieldAccess
One thing I have thought about is changing the hard coded lookup of function names from a pattern like this
datafusion/datafusion/sql/src/expr/value.rs
Lines 144 to 150 in fc34dac
To be something more structured
And then instead of
The planner might look like
But I haven't had a usecase to do that myself yet
Originally posted by @alamb in #10374 (comment)
The text was updated successfully, but these errors were encountered: