pub struct IpcReader<R> { /* private fields */ }
Expand description
Read Arrows IPC format into a DataFrame
Example
use polars_core::prelude::*;
use std::fs::File;
use polars_io::ipc::IpcReader;
use polars_io::SerReader;
fn example() -> Result<DataFrame> {
let file = File::open("file.ipc").expect("file not found");
IpcReader::new(file)
.finish()
}
Implementations
sourceimpl<R> IpcReader<R> where
R: Read + Seek,
impl<R> IpcReader<R> where
R: Read + Seek,
sourcepub fn schema(&mut self) -> Result<Schema, PolarsError>
pub fn schema(&mut self) -> Result<Schema, PolarsError>
Get schema of the Ipc File
sourcepub fn arrow_schema(&mut self) -> Result<Schema, PolarsError>
pub fn arrow_schema(&mut self) -> Result<Schema, PolarsError>
Get arrow schema of the Ipc File, this is faster than creating a polars schema.
sourcepub fn with_n_rows(self, num_rows: Option<usize>) -> IpcReader<R>
pub fn with_n_rows(self, num_rows: Option<usize>) -> IpcReader<R>
Stop reading when n
rows are read.
sourcepub fn with_columns(self, columns: Option<Vec<String, Global>>) -> IpcReader<R>
pub fn with_columns(self, columns: Option<Vec<String, Global>>) -> IpcReader<R>
Columns to select/ project
sourcepub fn with_row_count(self, row_count: Option<RowCount>) -> IpcReader<R>
pub fn with_row_count(self, row_count: Option<RowCount>) -> IpcReader<R>
Add a row_count
column.
sourcepub fn with_projection(
self,
projection: Option<Vec<usize, Global>>
) -> IpcReader<R>
pub fn with_projection(
self,
projection: Option<Vec<usize, Global>>
) -> IpcReader<R>
Set the reader’s column projection. This counts from 0, meaning that
vec![0, 4]
would select the 1st and 5th column.
pub fn finish_with_scan_ops(
self,
predicate: Option<Arc<dyn PhysicalIoExpr + 'static>>,
aggregate: Option<&[ScanAggregation]>,
projection: Option<&[usize]>
) -> Result<DataFrame, PolarsError>
Trait Implementations
Auto Trait Implementations
impl<R> RefUnwindSafe for IpcReader<R> where
R: RefUnwindSafe,
impl<R> Send for IpcReader<R> where
R: Send,
impl<R> Sync for IpcReader<R> where
R: Sync,
impl<R> Unpin for IpcReader<R> where
R: Unpin,
impl<R> UnwindSafe for IpcReader<R> where
R: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more