AnuragRaut08 commented on code in PR #51357:
URL: https://github.com/apache/arrow/pull/51357#discussion_r4053404258


##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1750,7 +1750,8 @@ class TypedColumnWriterImpl : public ColumnWriterImpl,
     internal::DefLevelsToBitmap(def_levels, batch_size, level_info_, &io);
     *out_values_to_write = io.values_read - io.null_count;
     *out_spaced_values_to_write = io.values_read;
-    *null_count = io.null_count;
+    // Include nulls from repeated ancestors, which are excluded from 
io.null_count.
+    *null_count = batch_size - *out_values_to_write;

Review Comment:
   Thanks, good catch. You're right that the compacted Arrow leaf null count 
and the Parquet-level null count need to remain separate. I'll keep 
`io.null_count` for the Arrow validity handling and use the total null count 
only for the Parquet statistics/page metadata paths.



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