Skip to content

Commit 123045c

Browse files
authored
deprecate max_statistics_size writer property (#6884)
1 parent 9a74a25 commit 123045c

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

parquet/src/bin/parquet-rewrite.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ fn main() {
242242
if let Some(value) = args.dictionary_page_size_limit {
243243
writer_properties_builder = writer_properties_builder.set_dictionary_page_size_limit(value);
244244
}
245+
#[allow(deprecated)]
245246
if let Some(value) = args.max_statistics_size {
246247
writer_properties_builder = writer_properties_builder.set_max_statistics_size(value);
247248
}

parquet/src/file/properties.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ pub const DEFAULT_DATA_PAGE_ROW_COUNT_LIMIT: usize = 20_000;
4141
/// Default value for [`WriterProperties::statistics_enabled`]
4242
pub const DEFAULT_STATISTICS_ENABLED: EnabledStatistics = EnabledStatistics::Page;
4343
/// Default value for [`WriterProperties::max_statistics_size`]
44+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
4445
pub const DEFAULT_MAX_STATISTICS_SIZE: usize = 4096;
4546
/// Default value for [`WriterProperties::max_row_group_size`]
4647
pub const DEFAULT_MAX_ROW_GROUP_SIZE: usize = 1024 * 1024;
@@ -350,7 +351,9 @@ impl WriterProperties {
350351

351352
/// Returns max size for statistics.
352353
/// Only applicable if statistics are enabled.
354+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
353355
pub fn max_statistics_size(&self, col: &ColumnPath) -> usize {
356+
#[allow(deprecated)]
354357
self.column_properties
355358
.get(col)
356359
.and_then(|c| c.max_statistics_size())
@@ -601,7 +604,9 @@ impl WriterPropertiesBuilder {
601604
/// Sets default max statistics size for all columns (defaults to `4096`).
602605
///
603606
/// Applicable only if statistics are enabled.
607+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
604608
pub fn set_max_statistics_size(mut self, value: usize) -> Self {
609+
#[allow(deprecated)]
605610
self.default_column_properties
606611
.set_max_statistics_size(value);
607612
self
@@ -706,7 +711,9 @@ impl WriterPropertiesBuilder {
706711
/// Sets max size for statistics for a specific column.
707712
///
708713
/// Takes precedence over [`Self::set_max_statistics_size`].
714+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
709715
pub fn set_column_max_statistics_size(mut self, col: ColumnPath, value: usize) -> Self {
716+
#[allow(deprecated)]
710717
self.get_mut_props(col).set_max_statistics_size(value);
711718
self
712719
}
@@ -896,6 +903,7 @@ struct ColumnProperties {
896903
codec: Option<Compression>,
897904
dictionary_enabled: Option<bool>,
898905
statistics_enabled: Option<EnabledStatistics>,
906+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
899907
max_statistics_size: Option<usize>,
900908
/// bloom filter related properties
901909
bloom_filter_properties: Option<BloomFilterProperties>,
@@ -934,6 +942,8 @@ impl ColumnProperties {
934942
}
935943

936944
/// Sets max size for statistics for this column.
945+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
946+
#[allow(deprecated)]
937947
fn set_max_statistics_size(&mut self, value: usize) {
938948
self.max_statistics_size = Some(value);
939949
}
@@ -998,7 +1008,9 @@ impl ColumnProperties {
9981008
}
9991009

10001010
/// Returns optional max size in bytes for statistics.
1011+
#[deprecated(since = "54.0.0", note = "Unused; will be removed in 56.0.0")]
10011012
fn max_statistics_size(&self) -> Option<usize> {
1013+
#[allow(deprecated)]
10021014
self.max_statistics_size
10031015
}
10041016

@@ -1142,10 +1154,6 @@ mod tests {
11421154
props.statistics_enabled(&ColumnPath::from("col")),
11431155
DEFAULT_STATISTICS_ENABLED
11441156
);
1145-
assert_eq!(
1146-
props.max_statistics_size(&ColumnPath::from("col")),
1147-
DEFAULT_MAX_STATISTICS_SIZE
1148-
);
11491157
assert!(props
11501158
.bloom_filter_properties(&ColumnPath::from("col"))
11511159
.is_none());
@@ -1222,13 +1230,11 @@ mod tests {
12221230
.set_compression(Compression::GZIP(Default::default()))
12231231
.set_dictionary_enabled(false)
12241232
.set_statistics_enabled(EnabledStatistics::None)
1225-
.set_max_statistics_size(50)
12261233
// specific column settings
12271234
.set_column_encoding(ColumnPath::from("col"), Encoding::RLE)
12281235
.set_column_compression(ColumnPath::from("col"), Compression::SNAPPY)
12291236
.set_column_dictionary_enabled(ColumnPath::from("col"), true)
12301237
.set_column_statistics_enabled(ColumnPath::from("col"), EnabledStatistics::Chunk)
1231-
.set_column_max_statistics_size(ColumnPath::from("col"), 123)
12321238
.set_column_bloom_filter_enabled(ColumnPath::from("col"), true)
12331239
.set_column_bloom_filter_ndv(ColumnPath::from("col"), 100_u64)
12341240
.set_column_bloom_filter_fpp(ColumnPath::from("col"), 0.1)
@@ -1260,7 +1266,6 @@ mod tests {
12601266
props.statistics_enabled(&ColumnPath::from("a")),
12611267
EnabledStatistics::None
12621268
);
1263-
assert_eq!(props.max_statistics_size(&ColumnPath::from("a")), 50);
12641269

12651270
assert_eq!(
12661271
props.encoding(&ColumnPath::from("col")),
@@ -1275,7 +1280,6 @@ mod tests {
12751280
props.statistics_enabled(&ColumnPath::from("col")),
12761281
EnabledStatistics::Chunk
12771282
);
1278-
assert_eq!(props.max_statistics_size(&ColumnPath::from("col")), 123);
12791283
assert_eq!(
12801284
props.bloom_filter_properties(&ColumnPath::from("col")),
12811285
Some(&BloomFilterProperties { fpp: 0.1, ndv: 100 })

0 commit comments

Comments
 (0)