Skip to main content

Native Python binding for Apache Hudi, based on hudi-rs.

Project description

Hudi logo

A native Rust library for Apache Hudi, with bindings to Python

hudi-rs ci hudi-rs codecov join hudi slack follow hudi x/twitter follow hudi linkedin

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hudi-0.1.0rc1.tar.gz (221.7 kB view details)

Uploaded Source

Built Distributions

hudi-0.1.0rc1-cp38-abi3-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.8+ Windows x86-64

hudi-0.1.0rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.9 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ x86-64

hudi-0.1.0rc1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (5.5 MB view details)

Uploaded CPython 3.8+ manylinux: glibc 2.17+ ARM64

hudi-0.1.0rc1-cp38-abi3-macosx_11_0_arm64.whl (5.1 MB view details)

Uploaded CPython 3.8+ macOS 11.0+ ARM64

hudi-0.1.0rc1-cp38-abi3-macosx_10_12_x86_64.whl (5.5 MB view details)

Uploaded CPython 3.8+ macOS 10.12+ x86-64

File details

Details for the file hudi-0.1.0rc1.tar.gz.

File metadata

  • Download URL: hudi-0.1.0rc1.tar.gz
  • Upload date:
  • Size: 221.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.0

File hashes

Hashes for hudi-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 a778a62acf26176170fa24e2fdfe64b2d742123c7df91c2bbe1bbae8cfe553fd
MD5 0bebd0db97de290e26558bf56b1c8486
BLAKE2b-256 b0cd253de43a3814de7d71e221de2a6ebc8164e3340501e28c63a7f643c4ee24

See more details on using hashes here.

File details

Details for the file hudi-0.1.0rc1-cp38-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for hudi-0.1.0rc1-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 26f462ba91067b68987106f75386f8d6297701f78f5c0b6fa976e4e47edad339
MD5 0d5bd77db09ec89685dc39a70ccaba89
BLAKE2b-256 f3785d10edac5e2998016242c880bbe512722be8eb5b6ec451c0cbef7187a179

See more details on using hashes here.

File details

Details for the file hudi-0.1.0rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hudi-0.1.0rc1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e2934d7f4925f47f566e6a97501d4c7e03748d30c10827cbd6c8959ceaccde66
MD5 381576151d4e0a59621c75c12e6437ba
BLAKE2b-256 57cc1fda25783682a10d3c8d986a3b233bde7b20f44848d9edf489b8b0144c5c

See more details on using hashes here.

File details

Details for the file hudi-0.1.0rc1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for hudi-0.1.0rc1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c81004b77b8c28b9353c5aaa4c74936a50a3a129a9fff7b3ebb386577f69a43d
MD5 7f235c7c6b59431973132b675bb0c678
BLAKE2b-256 7d0611bdda17e4d81929da8b48037d67e350e00aa9b4e22f6feab42ce3b40e2c

See more details on using hashes here.

File details

Details for the file hudi-0.1.0rc1-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for hudi-0.1.0rc1-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f66341b3d859c03c6376147df8dce44e35e75fe0a9b5bef7524fbe7a8d9056ca
MD5 be18d0855a93db3bc1038e9ee77f2f7b
BLAKE2b-256 a7b9946930770809b1c6edbc45eeb3066b8f644e12a5c30f87d427a843e199ae

See more details on using hashes here.

File details

Details for the file hudi-0.1.0rc1-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for hudi-0.1.0rc1-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cb18a2db7643c363be64f19f6ee6d3d04d3ab3afd24f9317d9579149154492f1
MD5 0077a7f3427187f407deb35ac2ee1069
BLAKE2b-256 4c4962f7323c78b9bc1e6c1916ccb447268720ef7ddbe58799281fb3871bac1b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page