pitrou commented on a change in pull request #10871:
URL: https://github.com/apache/arrow/pull/10871#discussion_r685391213



##########
File path: cpp/src/arrow/array/validate.cc
##########
@@ -637,6 +638,23 @@ struct ValidateArrayFullImpl {
 
 ARROW_EXPORT
 Status ValidateArrayFull(const ArrayData& data) {
+  if (data.null_count != -1) {
+    int64_t actual_null_count;
+    if (HasValidityBitmap(data.type->id()) && data.buffers[0]) {
+      // Do not call GetNullCount() as it would also set the `null_count` 
member
+      actual_null_count =
+          data.length - CountSetBits(data.buffers[0]->data(), data.offset, 
data.length);
+    } else if (data.type->id() == Type::NA) {
+      actual_null_count = data.length;

Review comment:
       https://issues.apache.org/jira/browse/ARROW-13589 may help spot such 
redundant checks.




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