alamb commented on code in PR #14440:
URL: https://github.com/apache/datafusion/pull/14440#discussion_r1939737630
##########
datafusion/expr-common/src/signature.rs:
##########
@@ -455,6 +461,46 @@ fn get_data_types(native_type: &NativeType) ->
Vec<DataType> {
}
}
+#[derive(Debug, Clone)]
+pub struct FunctionSignature {
+ pub parameters: Vec<ParameterSignature>,
+ /// The volatility of the function. See [Volatility] for more information.
+ pub volatility: Volatility,
+}
+
+pub type ParameterSignature = Vec<ParameterType>;
+
+#[derive(Debug, Clone, Eq, PartialOrd, Hash)]
+pub struct ParameterType {
+ pub param_type: LogicalTypeRef,
Review Comment:
I am worried that `Vec<Vec<ParameterType>>` might become challenging to
reason about. It would also be confusing about when one use this new signature
rather than `Signature::Coercable` 🤔
Given this seems very similar to `Signature::Coercable`, and
`Signature::Coercable` mirrors what we want pretty well, could add some new
information there on the allowed coercions rather than an entire new type
signature. Something like extending `Coercable` with rules could be used to
coerce to the target type:
```rust
pub enum TypeSignature {
...
Coercible(Vec<Coercion>),
...
}
```
Where `Coercion` looks like
```rust
struct Coercion {
desired_type: TypeSignatureClass,
allowed_casts: ... // also includes an option for User Defined?
}
```
🤔
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]