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



##########
File path: cpp/src/arrow/pretty_print.cc
##########
@@ -339,6 +339,17 @@ class ArrayPrinter : public PrettyPrinter {
     children.reserve(array.num_fields());
     for (int i = 0; i < array.num_fields(); ++i) {
       children.emplace_back(array.field(i));
+      // set field array null at index which parent struct is null,
+      // because StructBuilder#AppendNull dosen't set child null bitmap.
+      auto field_null_buf = array.field(i)->null_bitmap();
+      if (field_null_buf != nullptr) {
+        uint8_t* field_null_data = field_null_buf->mutable_data();

Review comment:
       > So in PrettyPrint, we need to change child null bitmap to ensure the 
correct output
   
   We certainly must not *change* the null bitmap. PrettyPrint just shows the 
child arrays as they are, it does not need to be changed here (such arrays can 
already be produced otherwise).




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to