Skip to main content

QvdStreamReader

Struct QvdStreamReader 

Source
pub struct QvdStreamReader<R: Read + Seek + BufRead> {
    pub header: QvdTableHeader,
    pub symbols: Vec<Vec<QvdSymbol>>,
    /* private fields */
}
Expand description

A streaming QVD reader that reads rows in chunks without loading the entire index table into memory at once.

Symbol tables are always loaded fully (they are needed for decoding), but the index table is read chunk by chunk.

Fields§

§header: QvdTableHeader§symbols: Vec<Vec<QvdSymbol>>

Implementations§

Source§

impl<R: Read + Seek + BufRead> QvdStreamReader<R>

Source

pub fn open(reader: R) -> QvdResult<Self>

Open a QVD file for streaming reading.

Source

pub fn total_rows(&self) -> usize

Total number of rows in the file.

Source

pub fn remaining_rows(&self) -> usize

Number of rows remaining to read.

Source

pub fn next_chunk(&mut self, chunk_size: usize) -> QvdResult<Option<QvdChunk>>

Read the next chunk of rows. Returns None when all rows have been read.

Source

pub fn next_chunk_indices( &mut self, chunk_size: usize, ) -> QvdResult<Option<(Vec<Vec<i64>>, usize, usize)>>

Read the next chunk as column indices (without resolving symbols). More efficient if you plan to do your own symbol resolution.

Source

pub fn read_filtered( &mut self, filter_col: &str, exists_index: &ExistsIndex, select_cols: Option<&[&str]>, chunk_size: usize, ) -> QvdResult<QvdTable>

Read filtered: stream the entire file, decode only the filter column per row, and collect indices only for matching rows and selected columns.

  • filter_col: column name to filter on
  • exists_index: ExistsIndex with values to match
  • select_cols: if Some, only include these columns in the output; if None, include all
  • chunk_size: number of rows to read per I/O chunk

Memory: symbol tables (small) + one chunk buffer + only matching row indices. For 87M rows with 23% match rate, this holds ~20M rows instead of 87M.

Source

pub fn reset(&mut self) -> QvdResult<()>

Reset reader to the beginning.

Source

pub fn column_names(&self) -> Vec<&str>

Column names.

Auto Trait Implementations§

§

impl<R> Freeze for QvdStreamReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for QvdStreamReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for QvdStreamReader<R>
where R: Send,

§

impl<R> Sync for QvdStreamReader<R>
where R: Sync,

§

impl<R> Unpin for QvdStreamReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for QvdStreamReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for QvdStreamReader<R>
where R: UnwindSafe,

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> 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, 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.