mapleFU commented on code in PR #44921:
URL: https://github.com/apache/arrow/pull/44921#discussion_r1868747841


##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1301,6 +1301,10 @@ class TypedColumnWriterImpl : public ColumnWriterImpl, 
public TypedColumnWriter<
     bool single_nullable_element =
         (level_info_.def_level == level_info_.repeated_ancestor_def_level + 1) 
&&
         leaf_field_nullable;
+    if (!leaf_field_nullable && leaf_array.null_count() != 0) {

Review Comment:
   ```c++
   int64_t ArrayData::GetNullCount() const {
     int64_t precomputed = this->null_count.load();
     if (ARROW_PREDICT_FALSE(precomputed == kUnknownNullCount)) {
       if (this->buffers[0]) {
         precomputed = this->length -
                       CountSetBits(this->buffers[0]->data(), this->offset, 
this->length);
       } else {
         precomputed = 0;
       }
       this->null_count.store(precomputed);
     }
     return precomputed;
   }
   ```
   
   `null_count()` call will generate null_count if not exists.



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