You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2021/05/19 19:38:45 UTC

[GitHub] [arrow-rs] sunchao commented on a change in pull request #307: ensure null-counts are written for all-null columns

sunchao commented on a change in pull request #307:
URL: https://github.com/apache/arrow-rs/pull/307#discussion_r635532034



##########
File path: parquet/src/column/writer.rs
##########
@@ -607,9 +607,11 @@ impl<T: DataType> ColumnWriterImpl<T> {
         let max_def_level = self.descr.max_def_level();
         let max_rep_level = self.descr.max_rep_level();
 
+        // always update column NULL count, no matter if page stats are used
+        self.num_column_nulls += self.num_page_nulls;

Review comment:
       hmm just curious why we don't need to update `self.num_page_nulls` accordingly, it is updated as follow:
   ```rust
               for &level in levels {
                   if level == self.descr.max_def_level() {
                       values_to_write += 1;
                   } else if calculate_page_stats {
                       self.num_page_nulls += 1
                   }
               }
   ```




-- 
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:
users@infra.apache.org