Skip to main content

Spark Connect Rust Client

A fast, native Rust client for Apache Spark Connect - and a drop-in pyspark replacement with 100% public-API parity with PySpark 4.3.0. It builds spark.connect protobuf plans, manages the gRPC channel, and decodes Arrow results in Rust, speaking the same protocol and returning the same results as the reference client.

PyPI Crates.io docs.rs Spark License

Rust coverage Python coverage

📖 Documentation

Full documentation lives at apache.github.io/spark-connect-rust

The Rust API reference (generated from the crate) is on docs.rs/apache-spark-connect.

Install

Python - a faster, drop-in replacement for the pyspark-client PyPI package (uninstall any existing pyspark / pyspark-client first):

pip install pyspark-client-rust

Your Spark Connect code then runs unchanged; use it exactly like PySpark.

Rust - the native crate:

[dependencies]
apache-spark-connect = "4.3"

Quickstart (Rust)

use spark_connect::{SparkSession, functions as f, lit};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let spark = SparkSession::builder()
        .remote("sc://localhost:15002")
        .get_or_create()?;

    let df = spark
        .range(1_000_000)?
        .select([(f::col("id") * lit(2)).alias("x")])
        .filter((f::col("x") % lit(3)).eq(lit(0)));

    println!("count = {}", df.count()?);
    df.show(20)?;
    Ok(())
}

See the documentation for the full API, running a Spark Connect server, and more.

User-Defined Functions (UDFs)

Write UDFs as plain Rust functions and call them directly — #[spark_wasm_udf] compiles them to WebAssembly and ships them to the executors:

use spark_connect::{SparkSession, col};
use spark_connect_macros::spark_wasm_udf;

#[spark_wasm_udf]
mod udfs {
    pub fn add_one(x: i64) -> i64 { x + 1 }
}

#[cfg(not(target_arch = "wasm32"))]
fn main() -> Result<(), Box<dyn std::error::Error>> {
    let spark = SparkSession::builder()
        .remote("sc://localhost:15002")
        .get_or_create()?;

    spark.range(5)?.select([udf::add_one(col("id"))?]).show(20)?;
    Ok(())
}

See the WASM UDF guide for the full setup, SQL registration, supported types, and more.

Contributing

Issues are tracked in ASF JIRA under SPARK (GitHub Issues are disabled). See the contributing guide.

License

Apache License 2.0.

Metadata

Release files for pyspark-client-rust 4.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyspark-client-rust 4.3.0
File Size Uploaded Provenance Actions
pyspark_client_rust-4.3.0.tar.gz 2.9 MB Without provenance Details for pyspark_client_rust-4.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyspark-client-rust 4.3.0
File Actions
pyspark_client_rust-4.3.0-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for pyspark_client_rust-4.3.0-cp39-abi3-win_amd64.whl
pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
pyspark_client_rust-4.3.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details for pyspark_client_rust-4.3.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Total release size: 66.2 MB

Release files / pyspark_client_rust-4.3.0.tar.gz

Download URL pyspark_client_rust-4.3.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
ed7df5621af43fb5998bcbde39508b88c00c74384722f30b9172b92bf304b95e
BLAKE2b-256 checksum
How to use checksums
b0ea82be78940925f5da7717875762241009d5fc8f14b4cdcc733c4abea588d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / pyspark_client_rust-4.3.0-cp39-abi3-win_amd64.whl

Download URL pyspark_client_rust-4.3.0-cp39-abi3-win_amd64.whl
Size 13.1 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
5d97b5444c0801a86e901c74dcddae764427c8e03ca7407d960c2a7331cb0965
BLAKE2b-256 checksum
How to use checksums
14e290756fdca615251707034e9dd96f9a245e7e2f603be382e32251ff0e389b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 12.7 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
324862c05f12f2d9a525c9ae993bdf8b283c2c1caf8be9dcc6d09f60967d6b4d
BLAKE2b-256 checksum
How to use checksums
84758ad529e8cf5cd2aa8cd2cef7b1d950f168286654c654796633c54a27c716
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL pyspark_client_rust-4.3.0-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 12.1 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
080f85f203741782289e06c169f619c4ad3bfe33a3bcb9855bce53e87299ed04
BLAKE2b-256 checksum
How to use checksums
998bae2e2d6a26ce6e73c894212a1ec635402072bb65624e93b6a06a7a83e3de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Release files / pyspark_client_rust-4.3.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL pyspark_client_rust-4.3.0-cp39-abi3-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
Size 25.3 MB
Tags CPython 3.9 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f5d4cb181713360ddf6acbf55eed30120350d90681d714eb2079255711a80285
BLAKE2b-256 checksum
How to use checksums
c55456496f7f09933a7c84f1ebf1c2d199af59a26464269269235954a24d8254
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.18

Security for pyspark-client-rust 4.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

4.3.0 This release

5 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page