rok commented on code in PR #52580:
URL: https://github.com/apache/arrow/pull/52580#discussion_r4391365668
##########
cpp/src/parquet/column_writer.cc:
##########
@@ -1057,9 +1057,12 @@ void ColumnWriterImpl::BuildDataPageV2(int64_t
definition_levels_rle_size,
bool page_is_compressed = false;
if (pager_->has_compressor() && values->size() > 0) {
pager_->Compress(*values, compressor_temp_buffer_.get());
- if (compressor_temp_buffer_->size() < values->size()) {
- page_is_compressed = true;
- }
+
+ const int64_t compressed = compressor_temp_buffer_->size();
+ const auto minimum = properties_->min_compression_savings();
+ page_is_compressed =
+ compressed < values->size() &&
+ 1.0 - static_cast<double>(compressed) / values->size() >= minimum;
Review Comment:
Could we change the default of `min_compression_savings` to `0.01`? or some
epsilon-like value? @pitrou
--
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]