Jefffrey commented on code in PR #19604:
URL: https://github.com/apache/datafusion/pull/19604#discussion_r2660001586


##########
datafusion/functions/src/math/iszero.rs:
##########
@@ -108,6 +115,11 @@ fn iszero(args: &[ArrayRef]) -> Result<ArrayRef> {
             |x| x == 0.0,
         )) as ArrayRef),
 
+        Float16 => Ok(Arc::new(BooleanArray::from_unary(
+            args[0].as_primitive::<Float16Type>(),
+            |x| x.to_f32() == 0.0,

Review Comment:
   ```suggestion
               |x| x.is_zero(),
   ```



##########
datafusion/functions/src/math/nanvl.rs:
##########
@@ -66,10 +67,14 @@ impl Default for NanvlFunc {
 
 impl NanvlFunc {
     pub fn new() -> Self {
-        use DataType::*;
+        let float = Coercion::new_implicit(
+            TypeSignatureClass::Float,
+            vec![TypeSignatureClass::Numeric],
+            NativeType::Float64,
+        );
         Self {
-            signature: Signature::one_of(
-                vec![Exact(vec![Float32, Float32]), Exact(vec![Float64, 
Float64])],
+            signature: Signature::coercible(
+                vec![float.clone(), float],

Review Comment:
   I think we might actually be better off leaving this as exact for now, since 
the coercible API doesn't have a good way to ensure both arguments are of the 
same type
   
   But we can include the f16 support, like
   
   ```rust
   SIgnature::one_of(
       vec![Exact(vec![Float16, Float16]), Exact(vec![Float32, Float32]), 
Exact(vec![Float64, Float64])]
   )
   ```



-- 
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]

Reply via email to