delta-io/delta-rs
GitHub: delta-io/delta-rs
Delta Lake 存储格式的原生 Rust 库,附带 Python 绑定,无需 Spark 即可实现支持 ACID 事务的数据湖读写与查询。
Stars: 3267 | Forks: 641
A native Rust library for Delta Lake, with bindings to Python
Python docs
·
Rust docs
·
Report a bug
·
Request a feature
·
Roadmap
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.
Delta Lake 项目旨在通过提供面向开发者和集成者的原生低级 API,
以及允许您轻松查询、检查和操作 Delta Lake 的高级操作 API,
将 Delta Lake 的强大功能释放给尽可能多的用户和项目。
| 来源 | 下载量 | 安装命令 | 文档 |
| ----------------------- | --------------------------------- | ----------------------- | --------------- |
| **[PyPi][pypi]** | [][pypi] | `pip install deltalake` | [Docs][py-docs] |
| **[Crates.io][crates]** | [][crates] | `cargo add deltalake` | [Docs][rs-docs] |
## 快速开始
`deltalake` 库旨在采用数据处理领域其他库的常见模式,
因此入门过程应该会让您感到熟悉。
```
from deltalake import DeltaTable, write_deltalake
import pandas as pd
# 将一些数据写入 delta table
df = pd.DataFrame({"id": [1, 2], "value": ["foo", "boo"]})
write_deltalake("./data/delta", df)
# 从 delta table 加载数据
dt = DeltaTable("./data/delta")
df2 = dt.to_pandas()
assert df.equals(df2)
```
同一个表也可以使用核心 Rust crate 加载:
```
use deltalake::{open_table, DeltaTableError};
use url::Url;
#[tokio::main]
async fn main() -> Result<(), DeltaTableError> {
// open the table written in python
let delta_path = Url::from_directory_path("/abs/data/delta").unwrap();
let table = open_table(delta_path).await?;
// show all active files in the table
let files: Vec<_> = table.get_file_uris()?.collect();
println!("{files:?}");
Ok(())
}
```
您也可以在 Docker 中尝试 Delta Lake,详见 [DockerHub](https://go.delta.io/dockerhub) | [Docker Repo](https://go.delta.io/docker)
## 集成
与 delta-rs 互操作的库和框架 - 按字母顺序排列。
- [AWS SDK for Pandas](https://github.com/aws/aws-sdk-pandas)
- [ballista][ballista]
- [datafusion][datafusion]
- [Daft](https://www.getdaft.io/)
- [Dask](https://github.com/dask-contrib/dask-deltatable)
- [datahub](https://datahubproject.io/)
- [DuckDB](https://duckdb.org/)
- [polars](https://www.pola.rs/)
- [Ray](https://github.com/delta-incubator/deltaray)
## 功能
查看完整的[功能表][feature-table]。
标签:Delta Lake, Gradle集成, Python, Rust, 可视化界面, 大数据存储, 数据湖, 无后门, 网络流量审计, 请求拦截, 逆向工具, 通知系统