polars_lazy/scan/
ipc.rs

1use arrow::buffer::Buffer;
2use polars_core::prelude::*;
3use polars_io::ipc::IpcScanOptions;
4use polars_utils::plpath::PlPath;
5
6use crate::prelude::*;
7
8impl LazyFrame {
9    /// Create a LazyFrame directly from a ipc scan.
10    pub fn scan_ipc(
11        path: PlPath,
12        options: IpcScanOptions,
13        unified_scan_args: UnifiedScanArgs,
14    ) -> PolarsResult<Self> {
15        Self::scan_ipc_sources(
16            ScanSources::Paths(Buffer::from_iter([path])),
17            options,
18            unified_scan_args,
19        )
20    }
21
22    pub fn scan_ipc_sources(
23        sources: ScanSources,
24        options: IpcScanOptions,
25        unified_scan_args: UnifiedScanArgs,
26    ) -> PolarsResult<Self> {
27        let lf = DslBuilder::scan_ipc(sources, options, unified_scan_args)?
28            .build()
29            .into();
30
31        Ok(lf)
32    }
33}