MashrafeeAryan commented on code in PR #52580:
URL: https://github.com/apache/arrow/pull/52580#discussion_r4381928788
##########
cpp/src/parquet/properties.h:
##########
@@ -529,6 +530,18 @@ class PARQUET_EXPORT WriterProperties {
return this;
}
+ /// Used to set minimum compression ratio threshold for V2 page data values
+ /// compression. If min_space_savings unset, keep compression if
compressed value is
+ /// smaller.
+ Builder* min_space_savings(std::optional<double> min_space_savings) {
Review Comment:
min_compression_savings seems like a good name
##########
python/pyarrow/tests/test_dataset.py:
##########
@@ -5949,6 +5949,47 @@ def test_write_dataset_content_defined_chunking(tempdir,
cdc):
assert ds.dataset(tempdir, format=fmt).to_table().equals(expected_table)
[email protected]
[email protected]("minimum", [None, 0.0, 0.1, 1.0])
+def test_parquet_min_space_savings(tempdir, minimum):
+ import pyarrow.parquet as pq
+
+ table = pa.table({
+ "value": pa.array([0.0] * 1000, type=pa.float32())
+ })
+ pq.write_to_dataset(
+ table,
+ tempdir,
+ compression="snappy",
+ use_dictionary=False,
+ data_page_version="2.0",
+ min_space_savings=minimum,
+ )
+
+ result = ds.dataset(tempdir, format="parquet").to_table()
+ assert result.equals(table)
+
+
[email protected]
+def test_dataset_min_space_savings_changes_size(tempdir):
Review Comment:
Merged them
--
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]