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>
impl<R: Read + Seek + BufRead> QvdStreamReader<R>
Sourcepub fn total_rows(&self) -> usize
pub fn total_rows(&self) -> usize
Total number of rows in the file.
Sourcepub fn remaining_rows(&self) -> usize
pub fn remaining_rows(&self) -> usize
Number of rows remaining to read.
Sourcepub fn next_chunk(&mut self, chunk_size: usize) -> QvdResult<Option<QvdChunk>>
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.
Sourcepub fn next_chunk_indices(
&mut self,
chunk_size: usize,
) -> QvdResult<Option<(Vec<Vec<i64>>, usize, usize)>>
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.
Sourcepub fn read_filtered(
&mut self,
filter_col: &str,
exists_index: &ExistsIndex,
select_cols: Option<&[&str]>,
chunk_size: usize,
) -> QvdResult<QvdTable>
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 onexists_index: ExistsIndex with values to matchselect_cols: if Some, only include these columns in the output; if None, include allchunk_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.
Sourcepub fn column_names(&self) -> Vec<&str>
pub fn column_names(&self) -> Vec<&str>
Column names.