Skip to main content

robin_sparkless/
lib.rs

1//! Robin Sparkless - A Rust DataFrame library with PySpark-like API
2//!
3//! This library provides a PySpark-compatible API built on top of Polars,
4//! offering high-performance data processing in pure Rust.
5//!
6//! # Panics and errors
7//!
8//! Some functions panic when used with invalid or empty inputs (e.g. calling
9//! `when(cond).otherwise(val)` without `.then()`, or passing no columns to
10//! `format_string`, `elt`, `concat`, `coalesce`, or `named_struct` in Rust).
11//! In Rust, `create_map` and `array` return `Result` for empty input instead of
12//! panicking. From Python, empty columns for `coalesce`, `format_string`,
13//! `printf`, and `named_struct` raise `ValueError`. See the documentation for
14//! each function for details.
15//!
16//! # API stability
17//!
18//! While the crate is in the 0.x series, we follow [semver](https://semver.org/) but may introduce
19//! breaking changes in minor releases (e.g. 0.1 → 0.2) until 1.0. For behavioral caveats and
20//! intentional differences from PySpark, see the [repository documentation](https://github.com/eddiethedean/robin-sparkless/blob/main/docs/PYSPARK_DIFFERENCES.md).
21
22pub mod column;
23pub mod dataframe;
24pub(crate) mod date_utils;
25pub mod expression;
26pub mod functions;
27pub mod plan;
28pub mod schema;
29pub mod session;
30pub mod type_coercion;
31pub(crate) mod udf_registry;
32pub(crate) mod udfs;
33
34#[cfg(feature = "sql")]
35pub mod sql;
36
37#[cfg(feature = "delta")]
38pub mod delta;
39
40#[cfg(feature = "pyo3")]
41pub mod python;
42
43pub use column::Column;
44pub use dataframe::{
45    CubeRollupData, DataFrame, GroupedData, JoinType, SaveMode, WriteFormat, WriteMode,
46};
47pub use functions::{SortOrder, *};
48pub use schema::{StructField, StructType};
49pub use session::{DataFrameReader, SparkSession, SparkSessionBuilder};