Native Python binding for Apache Hudi, based on hudi-rs.
Project description
A native Rust library for Apache Hudi, with bindings to Python
The hudi-rs
project aims to broaden the use of Apache Hudi for a diverse range of
users and projects.
Source | Installation Command |
---|---|
PyPi | pip install hudi |
Crates.io | cargo add hudi |
Example usage
Python
Read a Hudi table into a PyArrow table.
from hudi import HudiTable
hudi_table = HudiTable("/tmp/trips_table")
records = hudi_table.read_snapshot()
import pyarrow as pa
import pyarrow.compute as pc
arrow_table = pa.Table.from_batches(records)
result = arrow_table.select(
["rider", "ts", "fare"]).filter(
pc.field("fare") > 20.0)
print(result)
Rust
Add crate `hudi` with `datafusion` feature to your application to query a Hudi table.
[dependencies]
hudi = { version = "0" , features = ["datafusion"] }
tokio = "1"
datafusion = "39.0.0"
use std::sync::Arc;
use datafusion::error::Result;
use datafusion::prelude::{DataFrame, SessionContext};
use hudi::HudiDataSource;
#[tokio::main]
async fn main() -> Result<()> {
let ctx = SessionContext::new();
let hudi = HudiDataSource::new("/tmp/trips_table").await?;
ctx.register_table("trips_table", Arc::new(hudi))?;
let df: DataFrame = ctx.sql("SELECT * from trips_table where fare > 20.0").await?;
df.show().await?;
Ok(())
}
Work with cloud storage
Ensure cloud storage credentials are set properly as environment variables, e.g., AWS_*
, AZURE_*
, or GOOGLE_*
.
Relevant storage environment variables will then be picked up. The target table's base uri with schemes such
as s3://
, az://
, or gs://
will be processed accordingly.
Contributing
Check out the contributing guide for all the details about making contributions to the project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
File details
Details for the file hudi-0.1.0.tar.gz
.
File metadata
- Download URL: hudi-0.1.0.tar.gz
- Upload date:
- Size: 221.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2216a904e3eec8ba6ed3a9973d0f13f546e6b8c280ca1662755d9ff31fcdac5e |
|
MD5 | 394e7d61d5215f2e085177cf269d2c1c |
|
BLAKE2b-256 | 1074cfb4f8bb03fa437b472b580d512a7f387857a15ddc700f138d494adea851 |
File details
Details for the file hudi-0.1.0-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: hudi-0.1.0-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 5.6 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95b71bad1daf8b891986edfd792a86df6267375f436c3d17b702e09a764993c2 |
|
MD5 | edfdd1eba1d73cba3b8f64c295927cd4 |
|
BLAKE2b-256 | 8a8de44110cfd384887ae602c209e82464d1146f940d7e6be849f90f6d0e085f |
File details
Details for the file hudi-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: hudi-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 5.9 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca467ee176c825b52fc1577d47bfe78d012db74baa5fc5a9bb07e0ecdd8133d8 |
|
MD5 | 919458077e6950f483bf7c8eb516699c |
|
BLAKE2b-256 | 9e41c2c861f5a34874a5aef29a833733b3e308b87999d581c02f42c88cbf0c30 |
File details
Details for the file hudi-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: hudi-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45f9c0dbb3eff395b3cd727b73eca07faef65c065b7d0213ef7f3c999426f258 |
|
MD5 | 8894797e63ede1b0bfc6292711fb978e |
|
BLAKE2b-256 | 64378df49c7f4bd99288b63a6f4b5aedccd24bfea9f1f2a4c6d49c21f0f4251b |
File details
Details for the file hudi-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: hudi-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 5.1 MB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5d3689dfd2854e6948f22988de75fa9e87a3d04af952d93424afefef5b6adcd |
|
MD5 | 94a71f59db8d123d3643d8c8ed22f89c |
|
BLAKE2b-256 | ac0941c3039c86b8b8ced6bf6f31e7b1e4eeacd2d9550156be6b4f0f0ca3e1d6 |
File details
Details for the file hudi-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: hudi-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 5.5 MB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23e87222238ee43ab3e8bc2a5e81ea52426e637090b114d9860399a7dcde10c8 |
|
MD5 | d7bc075562c4701753179238ee2727d4 |
|
BLAKE2b-256 | af44a1e7bb2828df0f9df50d0b18badd618fa0765a4dafebde6ab50e3dfc6d54 |