Rich-T-kid commented on code in PR #10654:
URL: https://github.com/apache/arrow-rs/pull/10654#discussion_r3766718883
##########
parquet/src/file/properties.rs:
##########
@@ -880,6 +894,24 @@ impl WriterPropertiesBuilder {
self
}
+ /// Enable or disable writing the distinct value count
(`num_distinct_values`) into
+ /// row group column chunk statistics (defaults to `false` via
+ /// [`DEFAULT_WRITE_ROW_GROUP_NUMBER_DISTINCT_VALUES`]).
+ ///
+ /// When enabled, the [`ArrowWriter`] scans each column's values before
encoding
+ /// and stores the number of distinct non-null values in the row group
statistics
+ /// footer.
+ ///
+ /// # Performance
+ ///
+ /// Computing the distinct count requires hashing every non-null value in
the column.
+ /// For large row groups or columns with many values this adds measurable
overhead.
+ /// Benchmark your workload before enabling this globally.
Review Comment:
worth noting that turning the flag on does cause a 1.4x-8.8x regressions
for the arrow writer.
Happy to make a separate issue to improve the perf of the current approach.
I suspect this will also cause a decent regression when turned on since we need
an exact count which requires a hash set which is both expensive in term of
compute and memory.
--
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]