Skip to content

Repository files navigation

delta-rs logo

A native Rust library for Delta Lake, with bindings to Python
Python docs · Rust docs · Report a bug · Request a feature · Roadmap

DeltalakeCrateDeltalakeDeltalake#delta-rs in the Delta Lake Slack workspace

Delta Lake is an open-source storage format that runs on top of existing data lakes. Delta Lake is compatible with processing engines like Apache Spark and provides benefits such as ACID transaction guarantees, schema enforcement, and scalable data handling.

The Delta Lake project aims to unlock the power of the Deltalake for as many users and projects as possible by providing native low-level APIs aimed at developers and integrators, as well as a high-level operations API that lets you query, inspect, and operate your Delta Lake with ease.

SourceDownloadsInstallation CommandDocs
PyPiDownloadspip install deltalakeDocs
Crates.ioDownloadscargo add deltalakeDocs

Quick Start

The deltalake library aims to adopt patterns from other libraries in data processing, so getting started should look familiar.

fromdeltalakeimportDeltaTable, write_deltalakeimportpandasaspd# write some data into a delta tabledf=pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]})
write_deltalake("./data/delta", df)
# Load data from the delta tabledt=DeltaTable("./data/delta")
df2=dt.to_pandas()
assertdf.equals(df2)

The same table can also be loaded using the core Rust crate:

use deltalake::{open_table,DeltaTableError};use url::Url;#[tokio::main]asyncfnmain() -> Result<(),DeltaTableError>{// open the table written in pythonlet delta_path = Url::from_directory_path("/abs/data/delta").unwrap();let table = open_table(delta_path).await?;// show all active files in the tablelet files:Vec<_> = table.get_file_uris()?.collect();println!("{files:?}");Ok(())}

You can also try Delta Lake in Docker at DockerHub | Docker Repo

Get Involved

The delta-rs team is committed to providing a welcoming community.

Integrations

Libraries and frameworks that interoperate with delta-rs - in alphabetical order.

Features

The following section outlines some core features like supported storage backends and operations that can be performed against tables. The state of implementation of features outlined in the Delta protocol is also tracked.

Cloud Integrations

StorageRustPythonComment
Localdonedone
S3 - AWSdonedone
S3 - MinIOdonedone
S3 - R2donedone
Azure Blobdonedone
Azure ADLS Gen2donedone
Microsoft OneLakedonedone
Google Cloud Storagedonedone
HDFSdonedone
LakeFSdonedone

Supported Operations

OperationRustPythonDescription
CreatedonedoneCreate a new table
ReaddonedoneRead data from a table
VacuumdonedoneRemove unused files and log entries
Delete - predicatesdonedoneDelete data based on a predicate
Optimize - compactiondonedoneHarmonize the size of data file
Optimize - Z-orderdonedonePlace similar data into the same file
MergedonedoneMerge a target Delta table with source data
UpdatedonedoneUpdate values from a table
Add ColumndonedoneAdd new columns or nested fields
Add FeaturedonedoneEnable delta table features
Add ConstraintsdonedoneSet delta constraints, to verify data on write
Drop ConstraintsdonedoneRemoves delta constraints
Set Table PropertiesdonedoneSet delta table properties
Convert to DeltadonedoneConvert parquet table to delta table
FS checkdonedoneRemove corrupted files from table
RestoredonedoneRestores table to previous version state

Protocol Support Level

Writer VersionRequirementStatus
Version 2Append Only Tablesdone
Version 2Column Invariantsdone
Version 3Enforce delta.checkpoint.writeStatsAsJsondone
Version 3Enforce delta.checkpoint.writeStatsAsStructdone
Version 3CHECK constraintsdone
Version 4Change Data Feeddone
Version 4Generated Columnsdone
Version 5Column Mapping
Version 6Identity Columns
Version 7Table Featuresdone
Reader VersionRequirementStatus
Version 2Column Mapping
Version 3Table Features (requires reader V7)done

About

A native Rust library for Delta Lake, with bindings into Python and Ruby.

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages