Skip to main content

Sail Python library

Project description

Sail

Build Status Codecov PyPI Release Static Slack Badge

Sail is a drop-in Apache Spark replacement written in Rust, unifying batch processing, stream processing, and compute-intensive AI workloads on a distributed, multimodal compute engine.

  • Compatible with the Spark Connect protocol, supporting the Spark SQL and DataFrame API with no code rewrites required.
  • 100% Rust-native with no JVM overhead, delivering memory safety, instant startup, and predictable performance.
  • ~4× faster (up to 8× in specific workloads) than Spark and 94% cheaper on infrastructure costs. See derived TPC-H benchmarks.
  • Proven on ClickBench, outperforming Spark, popular Spark accelerators, Databricks, and Snowflake.

Documentation

The documentation of the latest Sail version can be found here.

Installation

Quick Start

Sail is available as a Python package on PyPI. You can install it along with PySpark in your Python environment.

pip install pysail
pip install "pyspark-client"

Advanced Use Cases

You can install Sail from source to optimize performance for your specific hardware architecture. The detailed Installation Guide walks you through this process step-by-step.

If you need to deploy Sail in production environments, the Deployment Guide provides comprehensive instructions for deploying Sail on Kubernetes clusters and other infrastructure configurations.

Getting Started

Starting the Sail Server

Option 1: Command Line Interface. You can start the local Sail server using the sail command.

sail spark server --port 50051

Option 2: Python API. You can start the local Sail server using the Python API.

from pysail.spark import SparkConnectServer

server = SparkConnectServer(port=50051)
server.start(background=False)

Option 3: Kubernetes. You can deploy Sail on Kubernetes and run Sail in cluster mode for distributed processing. Please refer to the Kubernetes Deployment Guide for instructions on building the Docker image and writing the Kubernetes manifest YAML file.

kubectl apply -f sail.yaml
kubectl -n sail port-forward service/sail-spark-server 50051:50051

Connecting to the Sail Server

Once you have a running Sail server, you can connect to it in PySpark. No changes are needed in your PySpark code!

from pyspark.sql import SparkSession

spark = SparkSession.builder.remote("sc://localhost:50051").getOrCreate()
spark.sql("SELECT 1 + 1").show()

Please refer to the Getting Started guide for further details.

Spark Compatibility

Sail is designed to be compatible with Spark 3.5.x, Spark 4.x, and later versions. Existing PySpark code works out of the box once you connect your Spark client session to Sail over the Spark Connect protocol.

As a starting point, Sail ships with an experimental PySpark function compatibility check script that scans your codebase for PySpark functions and reports their Sail support status.

python -m pysail.examples.spark.compatibility_check <directory>

Experimental Use the script as a rough first pass only. The script checks whether referenced PySpark functions are implemented in Sail. It does not verify behavioral parity. It looks for functions used in DataFrame operations but does not cover Spark SQL strings.

See the Migration Guide for recommended migration practices.

Feature Highlights

Lakehouse Formats and Catalog Providers

Sail provides native support for the Delta Lake and Apache Iceberg table formats. It integrates with catalog providers including Apache Iceberg REST Catalog, AWS Glue, Unity Catalog, Hive Metastore, and Microsoft OneLake.

For more details on usage and best practices, see the Data Sources Guide and Catalog Guide.

Storage

Sail supports a variety of storage backends for reading and writing data, including:

  • AWS S3
  • Azure
  • Hugging Face
  • Cloudflare R2
  • Google Cloud Storage
  • HDFS
  • File systems
  • HTTP/HTTPS
  • In-memory storage

See the Storage Guide for more details.

Why Choose Sail?

For over 15 years, Spark has been the default engine for distributed data processing, powering ETL, machine learning, and analytics pipelines across nearly every industry.

But the JVM foundation that made Spark possible is now what holds it back. Sail is built to be a familiar, performant alternative without the JVM tax.

Sail is Spark-compatible

Sail offers a drop-in replacement for Spark SQL and the Spark DataFrame API. Existing PySpark code works out of the box once you connect your Spark client session to Sail over the Spark Connect protocol.

  • Spark SQL Dialect Support. A custom Rust parser (built with parser combinators and Rust procedural macros) covers Spark SQL syntax with production-grade accuracy.
  • DataFrame API Support. Spark DataFrame operations run on Sail with identical semantics.
  • Python UDF, UDAF, UDWF, and UDTF Support. Python, Pandas, and Arrow UDFs all follow the same conventions as Spark.

Sail’s Advantages over Spark

  • Rust-Native Engine. No garbage collection pauses, no JVM memory tuning, and low memory footprint.
  • Columnar Format and Vectorized Execution. Built on top of Apache Arrow and Apache DataFusion, the columnar in-memory format and SIMD instructions unlock blazing-fast query execution.
  • Lightning-Fast Python UDFs. Python code runs inside Sail with zero serialization overhead as Arrow array pointers enable zero-copy data sharing.
  • Performant Data Shuffling. Workers exchange Arrow columnar data directly, minimizing shuffle costs for joins and aggregations.
  • Lightweight, Stateless Workers. Workers start in seconds, consume only a few megabytes of memory at idle, and scale elastically to cut cloud costs and simplify operations.
  • Concurrency and Memory Safety You Can Trust. Rust’s ownership model prevents null pointers, race conditions, and unsafe memory access for unmatched reliability.

Ready to bring your existing workloads over? Our Migration Guide shows you how.

Benchmark Results

Derived TPC-H results show that Sail outperforms Apache Spark in every query:

  • Execution Time: ~4× faster across diverse SQL workloads.
  • Hardware Cost: 94% lower with significantly lower peak memory usage and zero shuffle spill.
Metric Spark Sail
Total Query Time 387.36 s 102.75 s
Query Speed-Up Baseline 43% – 727%
Peak Memory Usage 54 GB 22 GB (1 s)
Disk Write (Shuffle Spill) > 110 GB 0 GB

These results come from a derived TPC-H benchmark (22 queries, scale factor 100, Parquet format) on AWS r8g.4xlarge instances.

Query Time Comparison

See the full analysis and graphs on our Benchmark Results page.

Further Reading

  • Architecture – Overview of Sail’s design for both local and cluster modes, and how it transitions seamlessly between them.
  • Query Planning – Detailed explanation of how Sail parses SQL and Spark relations, builds logical and physical plans, and handles execution for local and cluster modes.
  • SQL and DataFrame Features – Complete reference for Spark SQL and DataFrame API compatibility.
  • LakeSail Blog – Updates on Sail releases, benchmarks, and technical insights.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysail-0.6.5.tar.gz (2.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pysail-0.6.5-cp38-abi3-win_amd64.whl (61.4 MB view details)

Uploaded CPython 3.8+Windows x86-64

pysail-0.6.5-cp38-abi3-manylinux_2_24_aarch64.whl (52.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.24+ ARM64

pysail-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (56.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

pysail-0.6.5-cp38-abi3-macosx_11_0_arm64.whl (50.7 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

pysail-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl (54.6 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file pysail-0.6.5.tar.gz.

File metadata

  • Download URL: pysail-0.6.5.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysail-0.6.5.tar.gz
Algorithm Hash digest
SHA256 3058d9089e8b384382edfc744bbf7c08014c1b0787fb8776d1ad358a50cb3cbb
MD5 5b99d9f2ced62676545298553c88e01f
BLAKE2b-256 95c0970e3d4bccd9421c91eefff1560f0194fe3a5dcd6e4fe1cfde4a05c1e7ef

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.6.5.tar.gz:

Publisher: release.yml on lakehq/sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysail-0.6.5-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: pysail-0.6.5-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 61.4 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pysail-0.6.5-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 a2428b56dc8857f783ed3898afc7215d712c48690f52850fc26bc86275499188
MD5 78f720b74ded3aaf23c8e6ad457e5cee
BLAKE2b-256 3dd3d3d0e237a082a51ccffce727dc0a6783b0a982e840827794eb91481b09c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.6.5-cp38-abi3-win_amd64.whl:

Publisher: release.yml on lakehq/sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysail-0.6.5-cp38-abi3-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pysail-0.6.5-cp38-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 263f8952db08bb3dfebf9494456488936a5d3419df44a4714658ac2d2da71025
MD5 91457d519e165730f51035911ea0c569
BLAKE2b-256 6427c9a717f4b285f58af3c3bd6d7a0b05136e1f2902d44bfbe9e7127baab929

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.6.5-cp38-abi3-manylinux_2_24_aarch64.whl:

Publisher: release.yml on lakehq/sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysail-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysail-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e8d761c99f4be8dc5b7d1a048317e867d98af0f476127fee70c396694b7e43d2
MD5 03a171ed3e11e894935390c76fb1a870
BLAKE2b-256 1fdfdb7f327963339db0a97655f49c571c3915a075aab311b8464ca5aaca930c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.6.5-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on lakehq/sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysail-0.6.5-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysail-0.6.5-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 85259cdf1aa62f6eb12a5f9f841743b0e61fb7e8896247f14cf67fff55f3777e
MD5 18062b89a498ac674ee332152c1babbe
BLAKE2b-256 9314aac23f064aba3122cff20d57a4d87e0e0b21be968431f384f4963d64e0d4

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.6.5-cp38-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on lakehq/sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pysail-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pysail-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b97fbd69878512cf3f5568b80181b8627dc54f7c05f2a34c4378f07500600d95
MD5 f9d3f1506ac57edc72dcda0d745ccb3c
BLAKE2b-256 8adf96e0c740301e02d8d569f7d864c00146a285a0c7808a82d074398ee222cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.6.5-cp38-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on lakehq/sail

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page