Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-parquet/src/parquet/write/mod.rs
6940 views
1
mod column_chunk;
2
mod compression;
3
mod file;
4
mod indexes;
5
pub(crate) mod page;
6
mod row_group;
7
mod statistics;
8
9
#[cfg(feature = "async")]
10
mod stream;
11
#[cfg(feature = "async")]
12
#[cfg_attr(docsrs, doc(cfg(feature = "async")))]
13
pub use stream::FileStreamer;
14
15
mod dyn_iter;
16
pub use compression::{Compressor, compress};
17
pub use dyn_iter::{DynIter, DynStreamingIterator};
18
pub use file::{FileWriter, write_metadata_sidecar};
19
pub use row_group::ColumnOffsetsMetadata;
20
21
use crate::parquet::page::CompressedPage;
22
23
pub type RowGroupIterColumns<'a, E> =
24
DynIter<'a, Result<DynStreamingIterator<'a, CompressedPage, E>, E>>;
25
26
pub type RowGroupIter<'a, E> = DynIter<'a, RowGroupIterColumns<'a, E>>;
27
28
/// Write options of different interfaces on this crate
29
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
30
pub struct WriteOptions {
31
/// Whether to write statistics, including indexes
32
pub write_statistics: bool,
33
/// Which Parquet version to use
34
pub version: Version,
35
}
36
37
/// The parquet version to use
38
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
39
pub enum Version {
40
V1,
41
V2,
42
}
43
44
/// Used to recall the state of the parquet writer - whether sync or async.
45
#[derive(PartialEq)]
46
enum State {
47
Initialised,
48
Started,
49
Finished,
50
}
51
52
impl From<Version> for i32 {
53
fn from(version: Version) -> Self {
54
match version {
55
Version::V1 => 1,
56
Version::V2 => 2,
57
}
58
}
59
}
60
61