westonpace commented on code in PR #6608:
URL: https://github.com/apache/arrow-rs/pull/6608#discussion_r1809454090


##########
arrow-array/src/array/primitive_array.rs:
##########
@@ -1161,6 +1161,10 @@ impl<T: ArrowPrimitiveType> Array for PrimitiveArray<T> {
         self.nulls.as_ref()
     }
 
+    fn logical_null_count(&self) -> usize {
+        self.null_count()
+    }

Review Comment:
   Why overload here?



##########
arrow-array/src/array/null_array.rs:
##########
@@ -116,8 +117,8 @@ impl Array for NullArray {
         (self.len != 0).then(|| NullBuffer::new_null(self.len))
     }
 
-    fn is_nullable(&self) -> bool {
-        !self.is_empty()
+    fn logical_null_count(&self) -> usize {
+        self.len

Review Comment:
    This overload I understand (`self.len` is cheaper than allocating 
`NullBuffer:;new_null`) but what happened to `is_nullable`?  Was it just unused?



##########
arrow-array/src/array/boolean_array.rs:
##########
@@ -316,6 +316,10 @@ impl Array for BooleanArray {
         self.nulls.as_ref()
     }
 
+    fn logical_null_count(&self) -> usize {
+        self.null_count()
+    }

Review Comment:
   Why overload here?  Is this more efficient somehow?



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