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.

🚀 Sail outperforms Spark, popular Spark accelerators, Databricks, and Snowflake on ClickBench.

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 modern lakehouse table formats, offering reliable storage layers with strong data management guarantees and ensuring interoperability with existing datasets.

Please refer to the following guides for the supported formats:

Catalog Providers

Sail supports multiple catalog providers, such as the Apache Iceberg REST Catalog and Unity Catalog. You can manage datasets as external tables and integrate with broader data-platform ecosystems.

For more details on usage and best practices, see the Catalog 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 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.

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.

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

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.5.3.tar.gz (2.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.5.3-cp38-abi3-win_amd64.whl (59.5 MB view details)

Uploaded CPython 3.8+Windows x86-64

pysail-0.5.3-cp38-abi3-manylinux_2_24_aarch64.whl (51.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.24+ ARM64

pysail-0.5.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (55.0 MB view details)

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

pysail-0.5.3-cp38-abi3-macosx_11_0_arm64.whl (49.4 MB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

pysail-0.5.3-cp38-abi3-macosx_10_12_x86_64.whl (53.6 MB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for pysail-0.5.3.tar.gz
Algorithm Hash digest
SHA256 e1c61273874ae7093e6469d18d9555cc27c36d81e5144721a0039e697c82345c
MD5 d7236263856eb2908f7b610067bf6772
BLAKE2b-256 0aa33df99347f27ab2dfc2b39906ac6ea0846834e64a578cc7409d9ce0649efa

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.5.3.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.5.3-cp38-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for pysail-0.5.3-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eab04095ab74f3ce4d7690c1573c96c7c897cdde0f3bf55ed257efe92fc0e3c8
MD5 699a7a9e9b464174e9d355282c4200fa
BLAKE2b-256 14795cad6949ef797a49d6d99f01e613ba5eff6a86b07e40a546fde7f62800c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.5.3-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.5.3-cp38-abi3-manylinux_2_24_aarch64.whl.

File metadata

File hashes

Hashes for pysail-0.5.3-cp38-abi3-manylinux_2_24_aarch64.whl
Algorithm Hash digest
SHA256 d062c3e861254ece9d45a437438059bc3672ae61f206181d89a33429ed60f33b
MD5 1999f690e66666e7de5d66012e8c6dfb
BLAKE2b-256 33da43adf9976cfcf8b96e81638b1a2a88604814bc82184089e8f0560401f3c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.5.3-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.5.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pysail-0.5.3-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c5f0752bb91c8fae0f937d54b1a6e0ae2df4fdb4991fc5db0cc5f6a697ee56ed
MD5 50d10d43d152a86dee93eccca5818a2e
BLAKE2b-256 c1480ddbd5ee8cc6fc858ab99c5b2ca57c919afb2d613f2541ac84118711a278

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.5.3-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.5.3-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pysail-0.5.3-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4899fb9f48edbd38bb04d8720e1e983925acfe076424bf88dc9b334098bc6780
MD5 2f89ba1ccd11fb9f5436d2174b81b9d1
BLAKE2b-256 b68367456275d47d0cc954ab237454804b733928d52af14438395896aa7bdac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.5.3-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.5.3-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pysail-0.5.3-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 2e45bfed948920088fcd7a86ad62270829089b17a86263882546896ea20cf243
MD5 62fd79bd183e05535d6b71af572e2b39
BLAKE2b-256 b70e8a05ad0f58a0ddf3e269083d10c7d4d183b11a9027c9c42cf40f38c0af25

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysail-0.5.3-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