pq_glue/lib.rs
1//! Glue Parquet files together without decoding them.
2//!
3//! [`concat`](concat()) joins Parquet files that share one schema into one file by copying each
4//! row group's encoded column chunks (pages, dictionaries, statistics) as they are:
5//! nothing is decoded or re-encoded, so the cost is the bytes copied, whatever the
6//! nesting.
7//!
8//! The output has the inputs' row groups in order, the first input's schema and
9//! key-value metadata (`ARROW:schema`, which Arrow readers need for the files' Arrow
10//! types), the inputs' page indexes and bloom filters where they have them, and the
11//! inputs' column orders, under which their statistics were computed (see
12//! [`footer::restore_column_orders`]).
13//!
14//! ```no_run
15//! # fn main() -> pq_glue::Result<()> {
16//! use std::path::{Path, PathBuf};
17//!
18//! let inputs = [PathBuf::from("a.parquet"), PathBuf::from("b.parquet")];
19//! let rows = pq_glue::concat(&inputs, Path::new("ab.parquet"))?;
20//! # Ok(())
21//! # }
22//! ```
23//!
24//! With the `parallel` feature, `concat_many` runs many such concatenations at once,
25//! on rayon. With the `read` feature, [`read::read`] reads a file to Arrow record
26//! batches, its row groups decoded in parallel.
27
28mod concat;
29mod error;
30pub mod footer;
31mod input;
32#[cfg(feature = "python")]
33mod python;
34#[cfg(feature = "read")]
35pub mod read;
36#[cfg(feature = "write")]
37pub mod write;
38
39pub use concat::concat;
40#[cfg(feature = "parallel")]
41pub use concat::concat_many;
42pub use error::{Error, Result};