emkornfield commented on code in PR #40594:
URL: https://github.com/apache/arrow/pull/40594#discussion_r1855234963
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1708,10 +1790,15 @@ Status
TypedColumnWriterImpl<DType>::WriteArrowDictionary(
referenced_dictionary = referenced_dictionary_datum.make_array();
}
- int64_t non_null_count = chunk_indices->length() -
chunk_indices->null_count();
- page_statistics_->IncrementNullCount(num_chunk_levels - non_null_count);
- page_statistics_->IncrementNumValues(non_null_count);
- page_statistics_->Update(*referenced_dictionary, /*update_counts=*/false);
+ if (page_statistics_) {
+ int64_t non_null_count = chunk_indices->length() -
chunk_indices->null_count();
+ page_statistics_->IncrementNullCount(num_chunk_levels - non_null_count);
+ page_statistics_->IncrementNumValues(non_null_count);
+ page_statistics_->Update(*referenced_dictionary,
/*update_counts=*/false);
+ }
+ if (page_size_stats_builder_) {
+ page_size_stats_builder_->AddValues(*referenced_dictionary);
Review Comment:
For size statistics it is OK to maybe exclude them for the case where we
take pre-existing dictionary encoded data my main concern is we should never
have incorrect statistics (unless we are making unnecessary copies someplace I
would hope accurate collection isn't too expensive).
--
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]