Struct parquet::file::properties::WriterProperties
source · pub struct WriterProperties { /* private fields */ }
Expand description
Configuration settings for writing parquet files.
All properties except the key-value metadata are immutable,
use WriterPropertiesBuilder
to assemble these properties.
§Example
use parquet::{
basic::{Compression, Encoding},
file::properties::*,
schema::types::ColumnPath,
};
// Create properties with default configuration.
let props = WriterProperties::default();
// Use properties builder to set certain options and assemble the configuration.
let props = WriterProperties::builder()
.set_writer_version(WriterVersion::PARQUET_1_0)
.set_encoding(Encoding::PLAIN)
.set_column_encoding(ColumnPath::from("col1"), Encoding::DELTA_BINARY_PACKED)
.set_compression(Compression::SNAPPY)
.build();
assert_eq!(props.writer_version(), WriterVersion::PARQUET_1_0);
assert_eq!(
props.encoding(&ColumnPath::from("col1")),
Some(Encoding::DELTA_BINARY_PACKED)
);
assert_eq!(
props.encoding(&ColumnPath::from("col2")),
Some(Encoding::PLAIN)
);
Implementations§
source§impl WriterProperties
impl WriterProperties
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new WriterProperties
with the default settings
See WriterProperties::builder
for customising settings
sourcepub fn builder() -> WriterPropertiesBuilder
pub fn builder() -> WriterPropertiesBuilder
Returns builder for writer properties with default values.
sourcepub fn data_pagesize_limit(&self) -> usize
👎Deprecated since 41.0.0: Use data_page_size_limit
pub fn data_pagesize_limit(&self) -> usize
Returns data page size limit.
Note: this is a best effort limit based on the write batch size
sourcepub fn data_page_size_limit(&self) -> usize
pub fn data_page_size_limit(&self) -> usize
Returns data page size limit.
Note: this is a best effort limit based on the write batch size
For more details see WriterPropertiesBuilder::set_data_page_size_limit
sourcepub fn dictionary_pagesize_limit(&self) -> usize
👎Deprecated since 41.0.0: Use dictionary_page_size_limit
pub fn dictionary_pagesize_limit(&self) -> usize
Returns dictionary page size limit.
Note: this is a best effort limit based on the write batch size
sourcepub fn dictionary_page_size_limit(&self) -> usize
pub fn dictionary_page_size_limit(&self) -> usize
Returns dictionary page size limit.
Note: this is a best effort limit based on the write batch size
For more details see WriterPropertiesBuilder::set_dictionary_page_size_limit
sourcepub fn data_page_row_count_limit(&self) -> usize
pub fn data_page_row_count_limit(&self) -> usize
Returns the maximum page row count
Note: this is a best effort limit based on the write batch size
For more details see WriterPropertiesBuilder::set_data_page_row_count_limit
sourcepub fn write_batch_size(&self) -> usize
pub fn write_batch_size(&self) -> usize
Returns configured batch size for writes.
When writing a batch of data, this setting allows to split it internally into smaller batches so we can better estimate the size of a page currently being written.
sourcepub fn max_row_group_size(&self) -> usize
pub fn max_row_group_size(&self) -> usize
Returns maximum number of rows in a row group.
sourcepub fn writer_version(&self) -> WriterVersion
pub fn writer_version(&self) -> WriterVersion
Returns configured writer version.
sourcepub fn created_by(&self) -> &str
pub fn created_by(&self) -> &str
Returns created_by
string.
sourcepub fn key_value_metadata(&self) -> Option<&Vec<KeyValue>>
pub fn key_value_metadata(&self) -> Option<&Vec<KeyValue>>
Returns key_value_metadata
KeyValue pairs.
sourcepub fn sorting_columns(&self) -> Option<&Vec<SortingColumn>>
pub fn sorting_columns(&self) -> Option<&Vec<SortingColumn>>
Returns sorting columns.
sourcepub fn column_index_truncate_length(&self) -> Option<usize>
pub fn column_index_truncate_length(&self) -> Option<usize>
Returns the maximum length of truncated min/max values in the column index.
None
if truncation is disabled, must be greater than 0 otherwise.
sourcepub fn statistics_truncate_length(&self) -> Option<usize>
pub fn statistics_truncate_length(&self) -> Option<usize>
Returns the maximum length of truncated min/max values in statistics.
None
if truncation is disabled, must be greater than 0 otherwise.
sourcepub fn dictionary_data_page_encoding(&self) -> Encoding
pub fn dictionary_data_page_encoding(&self) -> Encoding
Returns encoding for a data page, when dictionary encoding is enabled. This is not configurable.
sourcepub fn dictionary_page_encoding(&self) -> Encoding
pub fn dictionary_page_encoding(&self) -> Encoding
Returns encoding for dictionary page, when dictionary encoding is enabled. This is not configurable.
sourcepub fn encoding(&self, col: &ColumnPath) -> Option<Encoding>
pub fn encoding(&self, col: &ColumnPath) -> Option<Encoding>
Returns encoding for a column, if set. In case when dictionary is enabled, returns fallback encoding.
If encoding is not set, then column writer will choose the best encoding based on the column type.
sourcepub fn compression(&self, col: &ColumnPath) -> Compression
pub fn compression(&self, col: &ColumnPath) -> Compression
Returns compression codec for a column.
sourcepub fn dictionary_enabled(&self, col: &ColumnPath) -> bool
pub fn dictionary_enabled(&self, col: &ColumnPath) -> bool
Returns true
if dictionary encoding is enabled for a column.
sourcepub fn statistics_enabled(&self, col: &ColumnPath) -> EnabledStatistics
pub fn statistics_enabled(&self, col: &ColumnPath) -> EnabledStatistics
Returns true
if statistics are enabled for a column.
sourcepub fn max_statistics_size(&self, col: &ColumnPath) -> usize
pub fn max_statistics_size(&self, col: &ColumnPath) -> usize
Returns max size for statistics. Only applicable if statistics are enabled.
sourcepub fn bloom_filter_properties(
&self,
col: &ColumnPath,
) -> Option<&BloomFilterProperties>
pub fn bloom_filter_properties( &self, col: &ColumnPath, ) -> Option<&BloomFilterProperties>
Returns the BloomFilterProperties
for the given column
Returns None
if bloom filter is disabled
Trait Implementations§
source§impl Clone for WriterProperties
impl Clone for WriterProperties
source§fn clone(&self) -> WriterProperties
fn clone(&self) -> WriterProperties
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WriterProperties
impl Debug for WriterProperties
Auto Trait Implementations§
impl Freeze for WriterProperties
impl RefUnwindSafe for WriterProperties
impl Send for WriterProperties
impl Sync for WriterProperties
impl Unpin for WriterProperties
impl UnwindSafe for WriterProperties
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)