Is your feature request related to a problem or challenge?
Some UDFs may expect a constant/scalar/literal argument, and not allow array inputs.
For example, arrow_cast:
|
type_arg |
|
.and_then(|sv| sv.try_as_str().flatten().filter(|s| !s.is_empty())) |
|
.map_or_else( |
|
|| { |
|
exec_err!( |
|
"{} requires its second argument to be a non-empty constant string", |
|
self.name() |
|
) |
|
}, |
|
|casted_type| match casted_type.parse::<DataType>() { |
|
Ok(data_type) => Ok(Field::new(self.name(), data_type, nullable).into()), |
|
Err(ArrowError::ParseError(e)) => Err(exec_datafusion_err!("{e}")), |
|
Err(e) => Err(arrow_datafusion_err!(e)), |
|
}, |
|
) |
Describe the solution you'd like
Some way to specify this at the signature level instead of needing this manual handling. This can then centralize the logic across the functions that need this.
Describe alternatives you've considered
No response
Additional context
Perhaps wire it only into the coercible signatures?
Is your feature request related to a problem or challenge?
Some UDFs may expect a constant/scalar/literal argument, and not allow array inputs.
For example,
arrow_cast:datafusion/datafusion/functions/src/core/arrow_cast.rs
Lines 134 to 148 in f27e50c
Describe the solution you'd like
Some way to specify this at the signature level instead of needing this manual handling. This can then centralize the logic across the functions that need this.
Describe alternatives you've considered
No response
Additional context
Perhaps wire it only into the coercible signatures?