Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-lazy/src/scan/ipc.rs
8445 views
1
use polars_buffer::Buffer;
2
use polars_core::prelude::*;
3
use polars_io::ipc::IpcScanOptions;
4
use polars_utils::pl_path::PlRefPath;
5
6
use crate::prelude::*;
7
8
impl LazyFrame {
9
/// Create a LazyFrame directly from a ipc scan.
10
pub fn scan_ipc(
11
path: PlRefPath,
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
}
34
35