-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge?
Considering a PR like this: #19435
It needs to accept an arbitrary expression for the first argument but an optional string argument for the second. There isn't really a good way to represent this in the current signature API, without doing the checks inside the function itself (as is done).
Describe the solution you'd like
Add an Any variant so we can specify a signature like TypeSignatureClass::Any, TypeSignatureClass::Native(logical_string()) to encode this information in the signature.
Describe alternatives you've considered
No response
Additional context
datafusion/datafusion/expr-common/src/signature.rs
Lines 321 to 342 in 2c3566c
| /// Represents the class of types that can be used in a function signature. | |
| /// | |
| /// This is used to specify what types are valid for function arguments in a more flexible way than | |
| /// just listing specific DataTypes. For example, TypeSignatureClass::Timestamp matches any timestamp | |
| /// type regardless of timezone or precision. | |
| /// | |
| /// Used primarily with [`TypeSignature::Coercible`] to define function signatures that can accept | |
| /// arguments that can be coerced to a particular class of types. | |
| #[derive(Debug, Clone, Eq, PartialEq, PartialOrd, Hash)] | |
| pub enum TypeSignatureClass { | |
| Timestamp, | |
| Time, | |
| Interval, | |
| Duration, | |
| Native(LogicalTypeRef), | |
| Integer, | |
| Float, | |
| Decimal, | |
| Numeric, | |
| /// Encompasses both the native Binary/LargeBinary types as well as arbitrarily sized FixedSizeBinary types | |
| Binary, | |
| } |
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request