pub struct ParxWriter { /* private fields */ }Expand description
Writer for PARX sidecar files.
Builds a PARX file from Parquet footer bytes and optional extensions.
Implementations§
Source§impl ParxWriter
impl ParxWriter
Sourcepub fn from_parquet_bytes(data: &[u8]) -> Result<Self>
pub fn from_parquet_bytes(data: &[u8]) -> Result<Self>
Create a writer pre-populated from in-memory Parquet bytes.
Validates the PAR1 magic, extracts the footer, and sets source_size.
Sourcepub fn from_parquet_file(path: impl AsRef<Path>) -> Result<Self>
pub fn from_parquet_file(path: impl AsRef<Path>) -> Result<Self>
Create a writer pre-populated from a Parquet file on disk.
Reads the file tail, validates PAR1 magic, extracts the footer,
and sets both source_size and source_uri.
Sourcepub fn set_source_uri(&mut self, uri: impl Into<String>)
pub fn set_source_uri(&mut self, uri: impl Into<String>)
Set the source Parquet file URI (optional, informational).
Sourcepub fn set_source_size(&mut self, size: u64)
pub fn set_source_size(&mut self, size: u64)
Set the source Parquet file size (required for validation).
Set the Parquet footer bytes to cache.
Set the Parquet footer bytes to cache (move version, avoids copy when possible).
Sourcepub fn set_compression(&mut self, compression: Compression)
pub fn set_compression(&mut self, compression: Compression)
Set the compression algorithm for the footer.
Sourcepub fn clear_compression(&mut self)
pub fn clear_compression(&mut self)
Clear compression (store footer uncompressed).
Sourcepub fn auto_compress(&mut self)
pub fn auto_compress(&mut self)
Enable auto-compression if footer exceeds threshold.
Uses Zstd compression for footers larger than 10KB.
Sourcepub const fn compression(&self) -> Option<Compression>
pub const fn compression(&self) -> Option<Compression>
Get the current compression setting.
Sourcepub const fn source_size(&self) -> u64
pub const fn source_size(&self) -> u64
Get the source Parquet file size.
Get the cached footer size in bytes.
Sourcepub fn set_page_indexes(&mut self, bytes: &[u8])
pub fn set_page_indexes(&mut self, bytes: &[u8])
Set the page index bytes to cache.
Page indexes include ColumnIndex and OffsetIndex structures from Parquet V2.
These are concatenated together in the order they appear in the file.
Sourcepub fn set_page_indexes_owned(&mut self, bytes: impl Into<Bytes>)
pub fn set_page_indexes_owned(&mut self, bytes: impl Into<Bytes>)
Set the page index bytes to cache (move version, avoids copy when possible).
Sourcepub fn has_page_indexes(&self) -> bool
pub fn has_page_indexes(&self) -> bool
Check if page indexes have been added.