bkietz commented on code in PR #38252:
URL: https://github.com/apache/arrow/pull/38252#discussion_r1363920591


##########
cpp/src/arrow/array/validate.cc:
##########
@@ -440,9 +422,28 @@ struct ValidateArrayImpl {
     return data.buffers[index] != nullptr && data.buffers[index]->address() != 
0;
   }
 
-  Status RecurseInto(const ArrayData& related_data) {
-    ValidateArrayImpl impl{related_data, full_validation};
-    return impl.Validate();
+  template <typename... FieldDescription>
+  Status RecurseIntoField(int field_index, const FieldDescription&... 
description) {
+    const auto& related_data = *data.child_data[field_index];
+
+    if (!data.type->storage_type_ref().field(field_index)->nullable()) {
+      if (related_data.null_count != 0 && related_data.null_count != 
kUnknownNullCount) {

Review Comment:
   Null count is computed below in `ValidateNulls`, which avoids counting nulls 
if `null_count` isn't set and avoids setting `null_count`. I was following that 
convention here, and it seemed unsatisfactory to count nulls twice in a 
non-caching context. Should I count nulls here after all?



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