pub struct ParquetWriter<W> { /* private fields */ }
Available on crate feature
polars-io
only.Expand description
Write a DataFrame to Parquet format.
Implementations§
Source§impl<W> ParquetWriter<W>where
W: Write,
impl<W> ParquetWriter<W>where
W: Write,
Sourcepub fn new(writer: W) -> ParquetWriter<W>where
W: Write,
pub fn new(writer: W) -> ParquetWriter<W>where
W: Write,
Create a new writer
Sourcepub fn with_compression(
self,
compression: ParquetCompression,
) -> ParquetWriter<W>
pub fn with_compression( self, compression: ParquetCompression, ) -> ParquetWriter<W>
Set the compression used. Defaults to Zstd
.
The default compression Zstd
has very good performance, but may not yet been supported
by older readers. If you want more compatibility guarantees, consider using Snappy
.
Sourcepub fn with_statistics(self, statistics: StatisticsOptions) -> ParquetWriter<W>
pub fn with_statistics(self, statistics: StatisticsOptions) -> ParquetWriter<W>
Compute and write statistic
Sourcepub fn with_row_group_size(self, size: Option<usize>) -> ParquetWriter<W>
pub fn with_row_group_size(self, size: Option<usize>) -> ParquetWriter<W>
Set the row group size (in number of rows) during writing. This can reduce memory pressure and improve writing performance.
Sourcepub fn with_data_page_size(self, limit: Option<usize>) -> ParquetWriter<W>
pub fn with_data_page_size(self, limit: Option<usize>) -> ParquetWriter<W>
Sets the maximum bytes size of a data page. If None
will be 1024^2 bytes.
Sourcepub fn set_parallel(self, parallel: bool) -> ParquetWriter<W>
pub fn set_parallel(self, parallel: bool) -> ParquetWriter<W>
Serialize columns in parallel
Sourcepub fn with_key_value_metadata(
self,
key_value_metadata: Option<KeyValueMetadata>,
) -> ParquetWriter<W>
pub fn with_key_value_metadata( self, key_value_metadata: Option<KeyValueMetadata>, ) -> ParquetWriter<W>
Set custom file-level key value metadata for the Parquet file
Sourcepub fn with_context_info(
self,
context_info: Option<HashMap<String, String, RandomState>>,
) -> ParquetWriter<W>
pub fn with_context_info( self, context_info: Option<HashMap<String, String, RandomState>>, ) -> ParquetWriter<W>
Set context information for the writer
pub fn batched( self, schema: &Schema<DataType>, ) -> Result<BatchedWriter<W>, PolarsError>
Auto Trait Implementations§
impl<W> Freeze for ParquetWriter<W>where
W: Freeze,
impl<W> !RefUnwindSafe for ParquetWriter<W>
impl<W> Send for ParquetWriter<W>where
W: Send,
impl<W> Sync for ParquetWriter<W>where
W: Sync,
impl<W> Unpin for ParquetWriter<W>where
W: Unpin,
impl<W> !UnwindSafe for ParquetWriter<W>
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more