Skip to main content

delta-explain

crates.io PyPI CI license

Make Delta pruning visible. delta-explain shows how partition pruning and data skipping narrow the set of candidate files in a Delta table.

Use it from the shell, through its versioned JSON contract and Python API, or in CI as a threshold-based guardrail. Point it at a local Delta table, an s3://, az://, or gs:// location, or a Unity Catalog table name (--catalog unity), read with the credentials the catalog vends.

delta-explain is strictly read-only: it reads Delta transaction-log metadata, not table rows, and performs no writes, locks, or telemetry. This keeps its data-access surface small. Its guarantees are documented in docs/semantics.md.

Documentation: cdelmonte-zg.github.io/delta-explain

Install

Choose one:

brew tap cdelmonte-zg/tap && brew install delta-explain    # Homebrew (macOS, Linux)
pip install delta-explain                                  # PyPI: binary wheel + Python API
cargo install delta-explain                                # crates.io (Rust 1.88+)
docker pull ghcr.io/cdelmonte-zg/delta-explain             # Docker (amd64 + arm64)

Every other route - pre-built binaries and .deb packages for six targets, Scoop, from Git - is on the install page.

Usage

The three ways in: the shell, Python, CI.

From the shell

delta-explain ./my-table --where "age > 40 AND country = 'DE'"
delta-explain run on a table with a two-column predicate: the predicate analysis with stats coverage, two pruning phases, and the total reduction 6 -> 1 files (83% pruned)

With --verbose, the per-file view - which files were kept or dropped, and why:

delta-explain --verbose - the per-file listing: four files DROPPED and two KEPT by partition pruning, each with size, records, partition values and stats ranges

Cloud tables authenticate through the provider's ambient credential chain, environment variables (--env-creds), AWS profiles (--profile), or explicit --option pairs; the per-provider recipes are in the cloud storage guide.

A table in Unity Catalog can be named instead of located. The catalog answers with the storage location and vends temporary credentials for it, so no cloud credentials of your own are involved:

export DATABRICKS_HOST=https://<workspace>.cloud.databricks.com DATABRICKS_TOKEN=<token>
delta-explain --catalog unity sales.events.orders --where "age > 40 AND country = 'DE'"
delta-explain --catalog unity on a table named sales.events.orders: a Resolved line shows the storage location the catalog answered with, then the same predicate analysis and pruning phases as for a path

The Resolved: line is the only addition; the JSON carries the resolution in a catalog object. The full flag list is delta-explain --help, or the CLI reference. Predicates are standard SQL WHERE syntax; the supported constructs, with what each one can prune, are in the predicate syntax reference.

From Python

The PyPI wheel ships the compiled binary (the delta-explain command works from the same environment) plus a thin Python API around the JSON contract:

from delta_explain import explain

report = explain("s3://warehouse/events",
                 where="country = 'DE' AND age > 40",
                 min_pruning=80, env_creds=True)
report.passed              # gate outcome; False means the CLI would exit 1
report.total_pruning_pct

report = explain("sales.events.orders", catalog="unity", where="country = 'DE' AND age > 40")
report.catalog["location"]  # what the catalog resolved the name to

Gate failures come back as a report with passed == False; runtime errors raise DeltaExplainError with the CLI's message: the same exit-code contract as the command line, in Python types. More in the Python guide.

In CI, as a gate

--min-pruning <PCT> fails the run (exit 1) when total pruning falls below the threshold; --assert-stats fails it when any file in the snapshot is missing statistics:

delta-explain s3://warehouse/events -w "date = '2024-01-15'" --min-pruning 90 --assert-stats

The repo doubles as a composite GitHub Action, so the gate is one step. Pin the tag: the action downloads a released binary, so the ref you pin is the behavior you get.

- uses: cdelmonte-zg/delta-explain@v0.8.1
  with:
    table: s3://warehouse/events
    where: "country = 'DE' AND age > 40"
    min-pruning: "60"
    assert-stats: "true"
    env-creds: "true"

Inputs mirror the CLI flags; the step fails when a gate fails and exposes pruning-pct, final-files, and result as outputs for later steps. With catalog: unity the table input is a name, and the step reads DATABRICKS_HOST and DATABRICKS_TOKEN from its env:

- uses: cdelmonte-zg/delta-explain@v0.8.1
  with:
    table: sales.events.orders
    catalog: unity
    where: "country = 'DE' AND age > 40"
    min-pruning: "60"
  env:
    DATABRICKS_HOST: ${{ vars.DATABRICKS_HOST }}
    DATABRICKS_TOKEN: ${{ secrets.DATABRICKS_TOKEN }}

How to calibrate the threshold, keep the CI predicate semantically equivalent to the runtime query, and run the same gate from Docker: gating pruning in CI.

Examples

Every example in examples/ is executable and runs against real tables:

  • The three-minute quickstart - one script, five beats, each one thing delta-explain does.
  • Tuning a Delta table - a notebook that uses delta-explain to measure four layouts of real NYC-taxi data, from unpartitioned pile to date partitions plus fare-sorted files.
  • S3-compatible storage (RustFS) and a real GCS bucket - the same data pruning very differently depending on physical layout, on s3:// and gs:// tables.
  • Catalog resolution - a Hive Metastore and a Unity Catalog server next to RustFS and Spark: what each catalog answers for a table name, and delta-explain reading by name with the credentials Unity Catalog vends, on RustFS, ADLS Gen2 and GCS.

Performance

delta-explain reads only the Delta log, never the parquet data files, so its cost scales with the number of add actions, not with data volume. Measured at 200k files on Linux, local disk, in the three log shapes that matter (generate them yourself with cargo run --release --example gen_scale_log):

Log shape (200k files) Baseline With predicate Peak memory
single JSON commit ~1.0 s ~1.3 s ~280 MB
2000 JSON commits ~1.4 s ~2.2 s ~320 MB
2000 commits + parquet checkpoint ~0.8 s ~1.0 s ~240 MB

The most production-like shape (checkpointed) is also the fastest: the kernel reads one parquet checkpoint instead of replaying thousands of JSON commits. Scaling is linear at roughly 1.5 KB of resident memory per file, which extrapolates to ~1.5 GB at one million files; that is the current practical ceiling and it is a known limitation, not a hidden one. Predicate complexity is usually secondary to log size at this scale: an IN list with 500 items over 200k files adds about 0.4 s.

Data volume itself is invisible - what a big table costs is its log. A 10 TB profile (40k files x 256 MB, 31 stats columns, checkpointed; --wide 30 --file-size-mb 256) runs in ~1.5 s at ~470 MB; the pathological small-files version of the same 10 TB (160k files x 64 MB, same stats width) takes ~5 s at ~1.8 GB. Memory scales with files x stats leaves, so the one-million-file ceiling above assumes a narrow schema: wide production schemas reach it proportionally earlier, and delta.dataSkippingNumIndexedCols on the table bounds the width the log carries in the first place.

Output is the dimension to manage on large tables: the compact JSON stays summary-only at any size, and per-file detail (--verbose, in both formats) should be capped with --limit.

The report viewer

Reports are also emitted as versioned JSON (--format json) under a formal, CI-enforced contract - the schema and the field-by-field reference. Any saved report can be visualized as a self-contained HTML page - pruning funnel, analysis, per-file table - with one drop or one command; attach it to a CI run so a failed gate shows which phase did not prune, not just an exit code:

The report viewer rendering a pruning report: funnel, predicate analysis with stats coverage, diagnoses, per-file table

Deep dive

For a detailed walkthrough of the architecture, design decisions, and the reasoning behind the two-phase model, see the companion article: delta-explain: Making Delta Lake Pruning Visible.

Contributing

Build with cargo build && cargo test; the contributor guide - architecture, testing conventions, fixtures - is DEVELOPMENT.md.

License

MIT

Author

Christian Del Monte

delta-explain is built on delta-kernel-rs and focuses on making Delta-level file elimination visible.

Metadata

Release files for delta-explain 0.8.1

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

Built distributions (wheels)

Table of built distributions (wheels) for delta-explain 0.8.1
File Actions
delta_explain-0.8.1-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for delta_explain-0.8.1-py3-none-win_amd64.whl
delta_explain-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for delta_explain-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
delta_explain-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details for delta_explain-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
delta_explain-0.8.1-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for delta_explain-0.8.1-py3-none-macosx_11_0_arm64.whl
delta_explain-0.8.1-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for delta_explain-0.8.1-py3-none-macosx_10_12_x86_64.whl

Total release size: 71.5 MB

Release files / delta_explain-0.8.1-py3-none-win_amd64.whl

Download URL delta_explain-0.8.1-py3-none-win_amd64.whl
Size 13.4 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
6aea1b2b0284a88a9f6e5dbc9510f01b760e36875f5cdd148224888323732aa6
BLAKE2b-256 checksum
How to use checksums
3b4e44215dc1446a416cf4ec6875aa2bc39492bf20a0d7c67cf5b7ba297e67c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / delta_explain-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL delta_explain-0.8.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 15.3 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
4d04f45c53a9a5945f871b8734ba1588d490a5ad57ef072a4a8508a60c4da969
BLAKE2b-256 checksum
How to use checksums
0b1f3f21164b4dbcf4644f177d47bca1a930c9c8d5816afd85819ced5019c282
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / delta_explain-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL delta_explain-0.8.1-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 15.2 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
5843c151c6ba7a26961f0deecdbd2aa435d9f6be3c81a969ead8026000f0d777
BLAKE2b-256 checksum
How to use checksums
ff68aada726fa2339568fd8bbb16da048418b6a145036ebd488a4cb583081733
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / delta_explain-0.8.1-py3-none-macosx_11_0_arm64.whl

Download URL delta_explain-0.8.1-py3-none-macosx_11_0_arm64.whl
Size 13.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8f2832f23b0ae57fb04f2c1eb61097ddb2e6a443694ff4ac2a30d41e557b4c08
BLAKE2b-256 checksum
How to use checksums
4f3ef2a82e68f2445c6e212438a4f10cb5bd3b4c2b0fbc9adda8ce93405b09fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Release files / delta_explain-0.8.1-py3-none-macosx_10_12_x86_64.whl

Download URL delta_explain-0.8.1-py3-none-macosx_10_12_x86_64.whl
Size 14.3 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a11723101ad5bd640720f7fb4109323cc5e5b89f0464320e92238bd102a9727f
BLAKE2b-256 checksum
How to use checksums
1665dfdb4aa2879f3cac1ae012f095cffe0871e109a070f91dfb1e2fdd41b83c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

Security for delta-explain 0.8.1

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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for delta_explain-0.8.1-py3-none-win_amd64.whl

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 28, 2026.

Transparency log

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.

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