pub struct ParquetWriter<W> { /* private fields */ }
Available on crate feature
parquet
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 with_compression(self, compression: ParquetCompression) -> Self
pub fn with_compression(self, compression: ParquetCompression) -> Self
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) -> Self
pub fn with_statistics(self, statistics: StatisticsOptions) -> Self
Compute and write statistic
Sourcepub fn with_row_group_size(self, size: Option<usize>) -> Self
pub fn with_row_group_size(self, size: Option<usize>) -> Self
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>) -> Self
pub fn with_data_page_size(self, limit: Option<usize>) -> Self
Sets the maximum bytes size of a data page. If None
will be 1024^2 bytes.
Sourcepub fn set_parallel(self, parallel: bool) -> Self
pub fn set_parallel(self, parallel: bool) -> Self
Serialize columns in parallel
pub fn batched(self, schema: &Schema) -> PolarsResult<BatchedWriter<W>>
Sourcepub fn finish(self, df: &mut DataFrame) -> PolarsResult<u64>
pub fn finish(self, df: &mut DataFrame) -> PolarsResult<u64>
Write the given DataFrame in the writer W
. Returns the total size of the file.
Auto Trait Implementations§
impl<W> Freeze for ParquetWriter<W>where
W: Freeze,
impl<W> RefUnwindSafe for ParquetWriter<W>where
W: RefUnwindSafe,
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>where
W: UnwindSafe,
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