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



##########
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:
       Disallowing `kUnknownNullCount` for `Type::NA` seems to fail on some 
compute tests. I'm not sure it's worth fixing: it might also make some code 
pointlessly more complex.
   
   I don't really understand the rest of your comment. `data.null_count` is 
checked for incorrect values for `Type::NA` as well.




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