bkietz commented on a change in pull request #10871: URL: https://github.com/apache/arrow/pull/10871#discussion_r685381106
########## 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: Ah, nevermind: when I stop reading diagonally I see that we are ultimately checking `data.null_count == data.length`. Separate note: this is also enforced by `ValidateArray`, so I suppose this check is redundant -- 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: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org