@@ -126,13 +126,19 @@ pub enum TypeSignature {
126
126
Exact ( Vec < DataType > ) ,
127
127
/// One or more arguments belonging to the [`TypeSignatureClass`], in order.
128
128
///
129
- /// `Coercible(vec![TypeSignatureClass::Native (...)])` accepts any type castable to the
129
+ /// `Coercible(vec![TypeSignatureClass::AnyNative (...)])` accepts any type castable to the
130
130
/// target `NativeType` through the explicit set of type conversion rules defined in
131
- /// `NativeType::default_cast_for`
131
+ /// `NativeType::default_cast_for`.
132
132
///
133
- /// For example, `Coercible(vec![TypeSignatureClass::Native (logical_float64())])` accepts
133
+ /// For example, `Coercible(vec![TypeSignatureClass::AnyNative (logical_float64())])` accepts
134
134
/// arguments like `vec![Int32]` or `vec![Float32]` since i32 and f32 can be cast to f64.
135
135
///
136
+ /// `Coercible(vec![TypeSignatureClass::Native(...)])` is designed to cast between the same
137
+ /// logical type.
138
+ ///
139
+ /// For example, `Coercible(vec![TypeSignatureClass::Native(logical_int64())])` accepts
140
+ /// arguments like `vec![Int32]` since i32 is the same logical type as i64.
141
+ ///
136
142
/// Coercible(vec![TypeSignatureClass::Integer(...)])` accepts any
137
143
/// integer type (`NativeType::is_integer`) castable to the target integer `NativeType`.
138
144
///
@@ -222,9 +228,9 @@ pub enum TypeSignatureClass {
222
228
Interval ,
223
229
Duration ,
224
230
Native ( LogicalTypeRef ) ,
231
+ AnyNative ( LogicalTypeRef ) ,
232
+ Numeric ( LogicalTypeRef ) ,
225
233
Integer ( LogicalTypeRef ) ,
226
- // TODO:
227
- // Numeric
228
234
}
229
235
230
236
impl Display for TypeSignatureClass {
@@ -385,9 +391,10 @@ impl TypeSignature {
385
391
TypeSignature :: Coercible ( types) => types
386
392
. iter ( )
387
393
. map ( |logical_type| match logical_type {
388
- TypeSignatureClass :: Native ( l) | TypeSignatureClass :: Integer ( l) => {
389
- get_data_types ( l. native ( ) )
390
- }
394
+ TypeSignatureClass :: Native ( l)
395
+ | TypeSignatureClass :: AnyNative ( l)
396
+ | TypeSignatureClass :: Numeric ( l)
397
+ | TypeSignatureClass :: Integer ( l) => get_data_types ( l. native ( ) ) ,
391
398
TypeSignatureClass :: Timestamp => {
392
399
vec ! [
393
400
DataType :: Timestamp ( TimeUnit :: Nanosecond , None ) ,
0 commit comments