Skip to content

Commit 8d4ed72

Browse files
committed
chore: add constants for default cdc parameters
1 parent 87b50ea commit 8d4ed72

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

parquet/src/file/properties.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ pub const DEFAULT_STATISTICS_TRUNCATE_LENGTH: Option<usize> = Some(64);
6161
pub const DEFAULT_OFFSET_INDEX_DISABLED: bool = false;
6262
/// Default values for [`WriterProperties::coerce_types`]
6363
pub const DEFAULT_COERCE_TYPES: bool = false;
64+
/// Default minimum chunk size for content-defined chunking: 256 KiB.
65+
pub const DEFAULT_CDC_MIN_CHUNK_SIZE: usize = 256 * 1024;
66+
/// Default maximum chunk size for content-defined chunking: 1024 KiB.
67+
pub const DEFAULT_CDC_MAX_CHUNK_SIZE: usize = 1024 * 1024;
68+
/// Default normalization level for content-defined chunking.
69+
pub const DEFAULT_CDC_NORM_LEVEL: i32 = 0;
6470

6571
/// EXPERIMENTAL: Options for content-defined chunking (CDC).
6672
///
@@ -107,9 +113,9 @@ pub struct CdcOptions {
107113
impl Default for CdcOptions {
108114
fn default() -> Self {
109115
Self {
110-
min_chunk_size: 256 * 1024,
111-
max_chunk_size: 1024 * 1024,
112-
norm_level: 0,
116+
min_chunk_size: DEFAULT_CDC_MIN_CHUNK_SIZE,
117+
max_chunk_size: DEFAULT_CDC_MAX_CHUNK_SIZE,
118+
norm_level: DEFAULT_CDC_NORM_LEVEL,
113119
}
114120
}
115121
}

0 commit comments

Comments
 (0)