Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-io/src/parquet/read/mod.rs
6940 views
1
//! Functionality for reading Apache Parquet files.
2
//!
3
//! # Examples
4
//!
5
//! ```
6
//! use polars_core::prelude::*;
7
//! use polars_io::prelude::*;
8
//! use std::fs::File;
9
//!
10
//! fn example() -> PolarsResult<DataFrame> {
11
//! let r = File::open("example.parquet").unwrap();
12
//! let reader = ParquetReader::new(r);
13
//! reader.finish()
14
//! }
15
//! ```
16
17
#[cfg(feature = "cloud")]
18
mod async_impl;
19
mod mmap;
20
mod options;
21
mod read_impl;
22
mod reader;
23
mod utils;
24
25
const ROW_COUNT_OVERFLOW_ERR: PolarsError = PolarsError::ComputeError(ErrString::new_static(
26
"\
27
Parquet file produces more than pow(2, 32) rows; \
28
consider compiling with polars-bigidx feature (polars-u64-idx package on python), \
29
or set 'streaming'",
30
));
31
32
#[cfg(feature = "cloud")]
33
pub use async_impl::ParquetObjectStore;
34
pub use options::{ParallelStrategy, ParquetOptions};
35
use polars_error::{ErrString, PolarsError};
36
pub use polars_parquet::arrow::read::infer_schema;
37
pub use polars_parquet::read::FileMetadata;
38
pub use read_impl::{create_sorting_map, try_set_sorted_flag};
39
pub use reader::ParquetReader;
40
pub use utils::materialize_empty_df;
41
42
pub mod _internal {
43
pub use super::mmap::to_deserializer;
44
pub use super::read_impl::{PrefilterMaskSetting, calc_prefilter_cost};
45
pub use super::utils::ensure_matching_dtypes_if_found;
46
}
47
48