Is your feature request related to a problem or challenge?
Currently iszero() and isnan() coerce inputs to float to compute:
|
pub fn new() -> Self { |
|
// Accept any numeric type and coerce to float |
|
let float = Coercion::new_implicit( |
|
TypeSignatureClass::Float, |
|
vec![TypeSignatureClass::Numeric], |
|
NativeType::Float64, |
|
); |
|
Self { |
|
signature: Signature::coercible(vec![float], Volatility::Immutable), |
|
} |
|
} |
|
pub fn new() -> Self { |
|
// Accept any numeric type and coerce to float |
|
let float = Coercion::new_implicit( |
|
TypeSignatureClass::Float, |
|
vec![TypeSignatureClass::Numeric], |
|
NativeType::Float64, |
|
); |
|
Self { |
|
signature: Signature::coercible(vec![float], Volatility::Immutable), |
|
} |
|
} |
Describe the solution you'd like
Consider refactoring these to accept numeric types without coercing to float; the implementations should be simple (albeit verbose/tedious). For example, isnan() should return false for any numeric inputs that aren't float type, which might be a slight optimization.
Describe alternatives you've considered
If we prefer to keep the code simple we can leave it as is
Additional context
No response
Is your feature request related to a problem or challenge?
Currently
iszero()andisnan()coerce inputs to float to compute:datafusion/datafusion/functions/src/math/iszero.rs
Lines 61 to 71 in a02e683
datafusion/datafusion/functions/src/math/nans.rs
Lines 57 to 67 in a02e683
Describe the solution you'd like
Consider refactoring these to accept numeric types without coercing to float; the implementations should be simple (albeit verbose/tedious). For example,
isnan()should return false for any numeric inputs that aren't float type, which might be a slight optimization.Describe alternatives you've considered
If we prefer to keep the code simple we can leave it as is
Additional context
No response