Struct polars_io::parquet::ParquetReader
source · Available on crate feature
parquet
only.Expand description
Read Apache parquet format into a DataFrame.
Implementations§
source§impl<R: MmapBytesReader> ParquetReader<R>
impl<R: MmapBytesReader> ParquetReader<R>
pub fn _finish_with_scan_ops(
self,
predicate: Option<Arc<dyn PhysicalIoExpr>>,
projection: Option<&[usize]>
) -> PolarsResult<DataFrame>
Available on crate feature
lazy
only.sourcepub fn set_low_memory(self, low_memory: bool) -> Self
pub fn set_low_memory(self, low_memory: bool) -> Self
Try to reduce memory pressure at the expense of performance. If setting this does not reduce memory enough, turn off parallelization.
sourcepub fn read_parallel(self, parallel: ParallelStrategy) -> Self
pub fn read_parallel(self, parallel: ParallelStrategy) -> Self
Read the parquet file in parallel (default). The single threaded reader consumes less memory.
sourcepub fn with_n_rows(self, num_rows: Option<usize>) -> Self
pub fn with_n_rows(self, num_rows: Option<usize>) -> Self
Stop parsing when n
rows are parsed. By settings this parameter the csv will be parsed
sequentially.
sourcepub fn with_columns(self, columns: Option<Vec<String>>) -> Self
pub fn with_columns(self, columns: Option<Vec<String>>) -> Self
Columns to select/ project
sourcepub fn with_projection(self, projection: Option<Vec<usize>>) -> Self
pub fn with_projection(self, projection: Option<Vec<usize>>) -> Self
Set the reader’s column projection. This counts from 0, meaning that
vec![0, 4]
would select the 1st and 5th column.
sourcepub fn with_row_count(self, row_count: Option<RowCount>) -> Self
pub fn with_row_count(self, row_count: Option<RowCount>) -> Self
Add a row_count
column.
sourcepub fn schema(&mut self) -> PolarsResult<Schema>
pub fn schema(&mut self) -> PolarsResult<Schema>
Schema
of the file.
sourcepub fn num_rows(&mut self) -> PolarsResult<usize>
pub fn num_rows(&mut self) -> PolarsResult<usize>
Number of rows in the parquet file.
source§impl<R: MmapBytesReader + 'static> ParquetReader<R>
impl<R: MmapBytesReader + 'static> ParquetReader<R>
pub fn batched(self, chunk_size: usize) -> PolarsResult<BatchedParquetReader>
Trait Implementations§
source§impl<R: MmapBytesReader> SerReader<R> for ParquetReader<R>
impl<R: MmapBytesReader> SerReader<R> for ParquetReader<R>
source§fn new(reader: R) -> Self
fn new(reader: R) -> Self
Create a new ParquetReader
from an existing Reader
.
source§fn set_rechunk(self, rechunk: bool) -> Self
fn set_rechunk(self, rechunk: bool) -> Self
Rechunk to a single chunk after Reading file.
source§fn finish(self) -> PolarsResult<DataFrame>
fn finish(self) -> PolarsResult<DataFrame>
Take the SerReader and return a parsed DataFrame.