-
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
Support named query parameters #8245
Comments
I agree @simonvandel this is both a good idea, and would be a straightforward change |
I looked at the relevant code, and the placeholders are used in the following three sections:
I don't think 1 and 2 need to support named queries, just support 3 |
I don't fully understand what you are suggesting here. I thought the proposal was to change https://docs.rs/datafusion/latest/datafusion/dataframe/struct.DataFrame.html#method.with_param_values to take a different API, perhaps like pub fn with_param_values(self, param_values: Impl IntoIterator<Item = (&str, ScalarValue)>) -> Result<Self> So you could call it like
|
Maybe I can't describe it clearly, but my thoughts are the same as yours,thanks |
Is your feature request related to a problem or challenge?
https://docs.rs/datafusion/latest/datafusion/dataframe/struct.DataFrame.html#method.with_param_values allows filling query parameters with values. However, each parameter is positional, so that it corresponds to
$1
,$2
and so forth.In certain situations, it might be clearer to use named parameters, e.g
$foo
.Describe the solution you'd like
Would it be possible to support named query parameters?
On a cursory look, it seems like the underlying LogicalPlan already supports mapping parameter ids to values, so this might "just" be to change the
with_param_values
API to allow specifying the named parameter ids.Describe alternatives you've considered
Keep using positional query parameters.
Additional context
No response
The text was updated successfully, but these errors were encountered: