Skip to main content

ParxReader

Struct ParxReader 

Source
pub struct ParxReader { /* private fields */ }
Expand description

Reader for PARX sidecar files.

Parses and validates PARX files, providing access to the cached Parquet footer bytes and optional page index data.

Implementations§

Source§

impl ParxReader

Source

pub fn open(bytes: &[u8]) -> Result<Self>

Open a PARX file from bytes.

This validates the file structure, checksums, and extracts the manifest, footer payload, and optional page index data.

§Errors

Returns error if file is invalid or corrupted.

§Panics

Panics if file size is less than minimum header size.

Source

pub fn open_bytes(bytes: &Bytes) -> Result<Self>

Open a PARX file from owned Bytes (zero-copy where possible). Use this when you already have Bytes (e.g., from object_store) to potentially reduce allocations.

§Errors

Returns error if file is invalid or corrupted.

Source

pub const fn header(&self) -> &Header

Get the parsed header.

Source

pub const fn manifest(&self) -> &ParxManifest

Get the parsed manifest.

Source

pub fn footer_bytes(&self) -> &[u8]

Get the cached Parquet footer bytes (decompressed if necessary).

Source

pub const fn is_compressed(&self) -> bool

Check if the footer was stored compressed.

Source

pub const fn compression_algorithm(&self) -> Option<Compression>

Get the compression algorithm used, if any.

Get the original uncompressed footer size.

Returns 0 if footer was not compressed.

Source

pub const fn has_page_indexes(&self) -> bool

Check if this PARX file contains page index data.

Source

pub fn page_index_bytes(&self) -> Option<&[u8]>

Get raw page index payload bytes, if present (decompressed).

Page indexes include concatenated ColumnIndex and OffsetIndex structures from Parquet V2 format.

Source

pub const fn uncompressed_page_index_size(&self) -> u64

Get the original uncompressed page index size.

Returns 0 if page indexes were not compressed.

Source

pub const fn validate_source_size(&self, source_size: u64) -> bool

Validate that this PARX file matches the given Parquet file size.

This is the fast validation check that should always be performed before using cached footer bytes.

Validate that this PARX file matches the given Parquet footer hash.

This is the paranoid validation check that re-hashes the original Parquet footer bytes. Only use when you have the original footer.

Source

pub fn source_uri(&self) -> &str

Get the source URI from the manifest (may be empty).

Source

pub const fn source_size(&self) -> u64

Get the source file size from the manifest.

Source

pub const fn created_at_ms(&self) -> u64

Get the creation timestamp in milliseconds.

Trait Implementations§

Source§

impl Clone for ParxReader

Source§

fn clone(&self) -> ParxReader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParxReader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.