Skip to main content

Sail Python library

Project description

Sail

Build Status Codecov PyPI Release Static Slack Badge

Sail is an open-source unified and distributed multimodal computation framework created by LakeSail.

Our mission is to unify batch processing, stream processing, and compute-intensive AI workloads. Sail is a compute engine that is:

  • Compatible with the Spark Connect protocol, supporting the Spark SQL and DataFrame API with no code rewrites required.
  • ~4x faster than Spark in benchmarks (up to 8x in specific workloads).
  • 94% cheaper on infrastructure costs.
  • 100% Rust-native with no JVM overhead, delivering memory safety, instant startup, and predictable performance.

✨Using Sail? Tell us your story and get free merch!✨

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[connect]"

Alternatively, you can install the lightweight client package pyspark-client since Spark 4.0. The pyspark-connect package, which is equivalent to pyspark[connect], is also available since Spark 4.0.

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.

Feature Highlights

Storage

Sail supports a variety of storage backends for reading and writing data. You can read more details in our Storage Guide.

Here are the storage options supported:

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

Lakehouse Formats

Sail provides native support for Delta Lake, offering a reliable storage layer with strong data management guarantees and ensuring interoperability with existing Delta datasets.

For more details on usage and best practices, see the Delta Lake Guide.

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.

Contributing

Contributions are more than welcome!

Please submit GitHub issues for bug reports and feature requests. You are also welcome to ask questions in GitHub discussions.

Feel free to create a pull request if you would like to make a code change. You can refer to the Development Guide to get started.

Additionally, please join our Slack Community if you haven’t already!

Why Choose Sail?

When Spark was invented over 15 years ago, it was revolutionary. It redefined distributed data processing and powered ETL, machine learning, and analytics pipelines across industries.

But Spark’s JVM-based architecture now struggles to meet modern demands for performance and cloud efficiency:

  • Garbage collection pauses introduce latency spikes.
  • Serialization overhead slows data exchange between JVM and Python.
  • Heavy executors drive up cloud costs and complicate scaling.
  • Row-based processing performs poorly on analytical workloads and leaves hardware efficiency untapped.
  • Slow startup delays workloads, hurting interactive and on-demand use cases.

Sail solves these problems with a modern, Rust-native design.

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 the Spark 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.

Curious about how Sail stacks up against Spark? Explore our Why Sail? page. Ready to bring your existing workloads over? Our Migration Guide shows you how.

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.3.7.tar.gz (1.0 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.3.7-cp38-abi3-win_amd64.whl (45.6 MB view details)

Uploaded CPython 3.8+Windows x86-64

pysail-0.3.7-cp38-abi3-manylinux_2_24_aarch64.whl (40.7 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.24+ ARM64

pysail-0.3.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (45.3 MB view details)

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

pysail-0.3.7-cp38-abi3-macosx_11_0_arm64.whl (37.8 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

pysail-0.3.7-cp38-abi3-macosx_10_12_x86_64.whl (41.9 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: pysail-0.3.7.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for pysail-0.3.7.tar.gz
Algorithm Hash digest
SHA256 7a55da6c45b80d832cd12065c9506d6dabed098cc38d94dfa40c279a04cb533b
MD5 dffe901851b86a8cd453c82860c29e67
BLAKE2b-256 ae2a3f84be265b2460553183dcacb92ff1e830d61ecd98fed95e1b233bb3ec93

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysail-0.3.7-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 45.6 MB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.9.4

File hashes

Hashes for pysail-0.3.7-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eec078f248788bcd0e2c9c926b38147c1b914877bf05cb62c333321e5d7050f0
MD5 3fabcea9d082b87294482bfda26396e4
BLAKE2b-256 8840f3ef44f1dbd7886c98471665ef612b4d69b4468396f8ad670cc427cc9264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysail-0.3.7-cp38-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 d16e53c100736a951a442a1d630906a6ea4131e3453352d2eba3cea14a1e4134
MD5 aaac3de121a278003675a99db1c916c5
BLAKE2b-256 7d84e2c51195b04df173e9760671691a5d7e4673343213524de9cce3a0ca9983

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysail-0.3.7-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9c7237dba39dafea9c8d4a6a468eac01a125fd6f5e54cfd91580941ddbfa9bd0
MD5 d40d26fb423b7bb1981f72d1a92ebcd1
BLAKE2b-256 a9694cc2b6e4fcd6736fa6a489985bc7a2bd0c1e68a5e375b8a16df24ae64542

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysail-0.3.7-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 af5ee26dbbdc107d1b9acf45c5cad3d81ef97d8caa440ca9a8a3d85dea6ce177
MD5 e69e2b9c954fcc24c095c6e00880a08f
BLAKE2b-256 d7211984626640740cc2ee915bfedb741fbfa546e611826c56e3f23189bcf38b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pysail-0.3.7-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2203c21f4efb6b4133f7923d127747a9a0bdc19a3f08b92b25ac41b0f62b1158
MD5 82097e0444d8a4ec28c85a85c14130d0
BLAKE2b-256 ab3b64ba51d0d46a4dce0a67f8ba4bba1e9be49b875489db9be0ba3a2b761e67

See more details on using hashes here.

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