edponce commented on a change in pull request #10896:
URL: https://github.com/apache/arrow/pull/10896#discussion_r685352514



##########
File path: cpp/src/arrow/compute/kernels/scalar_validity.cc
##########
@@ -76,6 +77,22 @@ struct IsInfOperator {
 
 struct IsNullOperator {
   static Status Call(KernelContext* ctx, const Scalar& in, Scalar* out) {
+    bool is_nan_value = false;
+    bool is_floating = false;
+    if (in.type == float32()) {
+      is_nan_value = std::isnan(internal::UnboxScalar<FloatType>::Unbox(in));
+      is_floating = true;
+    } else if (in.type == float64()) {
+      is_nan_value = std::isnan(internal::UnboxScalar<DoubleType>::Unbox(in));
+      is_floating = true;
+    }

Review comment:
       @pitrou I would be curious if it is worth it to have a specialized 
version for floating point types (similar to how arithmetic kernels are 
implemented), as the `options.nan_is_null` check does not applies to other data 
types.




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


Reply via email to