-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
The logical expr Placeholder
is currently defined in terms of DataType
:
datafusion/datafusion/expr/src/expr.rs
Lines 1364 to 1374 in 35f45b5
/// Placeholder, representing bind parameter values such as `$1` or `$name`. | |
/// | |
/// The type of these parameters is inferred using [`Expr::infer_placeholder_types`] | |
/// or can be specified directly using `PREPARE` statements. | |
#[derive(Clone, PartialEq, Eq, PartialOrd, Hash, Debug)] | |
pub struct Placeholder { | |
/// The identifier of the parameter, including the leading `$` (e.g, `"$1"` or `"$foo"`) | |
pub id: String, | |
/// The type the parameter will be filled in with | |
pub data_type: Option<DataType>, | |
} |
We're hoping to use this to implement parameterized queries in SedonaDB and we'd love to be able to attach field metadata to this (either like Literal
with extra metadata, or like scalar functions where we use a FieldRef
).
It may be that these placeholder types are inferred correctly (I haven't checked).
Describe the solution you'd like
Either adding field metadata or expressing the data type as a field ref would allow literals with an extension type to be plugged in here.
Describe alternatives you've considered
We can produce non-parameterized SQL strings to function calls that produce an extension type.
Additional context
No response
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request