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.0rc2.tar.gz
.
File metadata
- Download URL: hudi-0.1.0rc2.tar.gz
- Upload date:
- Size: 221.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f9e988f45302ee0cf8c3a14c2a48fd15472e2f0337aa8f7e60ed789468078df |
|
MD5 | 5ea07f331167dcfc84a13018caa54316 |
|
BLAKE2b-256 | b4b42412bf72e140194278d5986b990ccd18bb142660fc56d5869998fcbb5f27 |
File details
Details for the file hudi-0.1.0rc2-cp38-abi3-win_amd64.whl
.
File metadata
- Download URL: hudi-0.1.0rc2-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 | d09a212a621b7d1afd62afe3f570dbbd1c41959a2083ec63b3b6e80919d1b54d |
|
MD5 | 4009f2a3162fb128181ff9d1141a4b72 |
|
BLAKE2b-256 | 7e85a0327dd8411e54ee145c62499f6f090cf9b019fac84729c0e1b2559381e7 |
File details
Details for the file hudi-0.1.0rc2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: hudi-0.1.0rc2-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 | c95d6c26418013113849886302c7ba6a4c1b18896f227fa9dec657c0c3d2f0f9 |
|
MD5 | b316153e138aacf50fd114853fe55be3 |
|
BLAKE2b-256 | a82578cb926854751bf75b67a90020d1bf232b75456f10820d0d1d23db7a98f5 |
File details
Details for the file hudi-0.1.0rc2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
.
File metadata
- Download URL: hudi-0.1.0rc2-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 | c620a5e380ff4a2753e2ecf01fc5547584eef544701aa560f0ed429a77a0c1fe |
|
MD5 | 41fe09707d5ad6dfbf963712b1f57364 |
|
BLAKE2b-256 | 682f53e171cf3cbe574b7ac4bb4b6a15c7608d72bebee7c580055587b123db67 |
File details
Details for the file hudi-0.1.0rc2-cp38-abi3-macosx_11_0_arm64.whl
.
File metadata
- Download URL: hudi-0.1.0rc2-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 | 5114a553681f8adfd0979104ed080081d9f68f95a09edbff77a4ae91463f58eb |
|
MD5 | 1ba7e3fe2b4e4e386c54c0ea78ecc766 |
|
BLAKE2b-256 | 82c903bbbc6bd986f028c4961a548aaa94e8bfefa987639024196b240b9ac595 |
File details
Details for the file hudi-0.1.0rc2-cp38-abi3-macosx_10_12_x86_64.whl
.
File metadata
- Download URL: hudi-0.1.0rc2-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 | 584d193c8b7c8ba9b3148aff0df26480dfe29a92657db96470eaee4e25e23878 |
|
MD5 | 6b1c41f8d94803850071ac8a049a93b4 |
|
BLAKE2b-256 | b7b5188dd6a5a34c6227f185a24f84a83aa337fdec2d8b01c7f28b350313ed30 |