No project description provided
Project description
PyPaimon Rust
This project builds the Rust-powered core for PyPaimon while also providing DataFusion integration for querying Paimon tables.
Install via PyPI:
pip install pypaimon-rust
If you want to use the native Python DataFusion SessionContext, install datafusion as well.
Query Paimon Tables with DataFusion
The recommended way to query Paimon tables is through SQLContext, which supports
multi-catalog registration, DDL, DML, and all Paimon-specific SQL extensions:
from pypaimon_rust.datafusion import SQLContext
ctx = SQLContext()
ctx.register_catalog("paimon", {
"warehouse": "/path/to/warehouse",
})
# DDL
ctx.sql("CREATE SCHEMA paimon.my_db")
ctx.sql("CREATE TABLE paimon.my_db.users (id INT, name STRING, PRIMARY KEY (id))")
# DML
ctx.sql("INSERT INTO paimon.my_db.users VALUES (1, 'alice'), (2, 'bob')")
# Query tables via SQL (catalog.database.table)
batches = ctx.sql("SELECT * FROM paimon.my_db.users")
Temporary Tables
You can register temporary in-memory tables programmatically. Names support the same resolution rules as SQL: bare names use the current catalog and database, partially qualified names use the current catalog, and fully qualified names specify catalog.database.table.
Register a single PyArrow RecordBatch as a temporary table:
import pyarrow as pa
batch = pa.record_batch([[1, 2], ["alice", "bob"]], names=["id", "name"])
ctx.register_batch("paimon.default.my_temp", batch)
batches = ctx.sql("SELECT * FROM paimon.default.my_temp")
# Drop it via SQL when no longer needed
ctx.sql("DROP TEMPORARY TABLE paimon.default.my_temp")
Alternatively, if you want to use the native Python DataFusion SessionContext,
install datafusion and register a PaimonCatalog:
from datafusion import SessionContext
from pypaimon_rust.datafusion import PaimonCatalog
catalog = PaimonCatalog({
"warehouse": "/path/to/warehouse",
})
ctx = SessionContext()
ctx.register_catalog_provider("paimon", catalog)
# Query tables via SQL (catalog.database.table)
df = ctx.sql("SELECT * FROM paimon.default.my_table LIMIT 10")
df.show()
REST Catalog
from datafusion import SessionContext
from pypaimon_rust.datafusion import PaimonCatalog
catalog = PaimonCatalog({
"metastore": "rest",
"uri": "http://localhost:8080",
"warehouse": "my_warehouse",
})
ctx = SessionContext()
ctx.register_catalog_provider("paimon", catalog)
Time travel queries are not supported in the Python binding at this time.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypaimon_rust-0.2.0.tar.gz.
File metadata
- Download URL: pypaimon_rust-0.2.0.tar.gz
- Upload date:
- Size: 588.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e0adb292bac8f59f94b6aac4bfad089afa3e8cc495d058ecd9e02713e248e82
|
|
| MD5 |
92bfe7bec31beb0c6b31dafdbf47ecc0
|
|
| BLAKE2b-256 |
a1e582badb3a5854224ef472f4c67ec514e67768783748d1cc05793e0b7199a3
|
File details
Details for the file pypaimon_rust-0.2.0-cp310-abi3-win_amd64.whl.
File metadata
- Download URL: pypaimon_rust-0.2.0-cp310-abi3-win_amd64.whl
- Upload date:
- Size: 49.4 MB
- Tags: CPython 3.10+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8cf96cab5a86335689d415f9b791fb8651af066d3004556a15c141139c7df94d
|
|
| MD5 |
084c7e770781369f21fba2770d21dc65
|
|
| BLAKE2b-256 |
e7167703226d64df0c4bb4474dbe6a220f48b960558690db8c72743dbfb05527
|
File details
Details for the file pypaimon_rust-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: pypaimon_rust-0.2.0-cp310-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 56.6 MB
- Tags: CPython 3.10+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93b869038094ec68cd7fbbf8a2d2302546504df59550ab18a99ec5550fb940f1
|
|
| MD5 |
133a278a8829d710b466cf3435c3f593
|
|
| BLAKE2b-256 |
94db8863929ba654292564f4af74715f0dcd3ebdb3f8f896d168ce8fd969fd80
|
File details
Details for the file pypaimon_rust-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pypaimon_rust-0.2.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 57.8 MB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc2b8d49e36c23ae9b7993d70560332ae1e0b21a119a3982bd2565f3f04ab15c
|
|
| MD5 |
196376c22ec235d3c518e132de1c25a1
|
|
| BLAKE2b-256 |
55056cd296c023e3dc7b398cc86304b873a4b3af3225ca00349ec262c3bdde7c
|
File details
Details for the file pypaimon_rust-0.2.0-cp310-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pypaimon_rust-0.2.0-cp310-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 50.3 MB
- Tags: CPython 3.10+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
643435655e0461a91af67102f5633706c73e153a0e2866838e9fdf110d72f80a
|
|
| MD5 |
453b9a36b605712ca4e927805e652a6f
|
|
| BLAKE2b-256 |
985735d2a297237f8ea72aa5a2d64592242ac427383ec86971b91eb368e87e3d
|
File details
Details for the file pypaimon_rust-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pypaimon_rust-0.2.0-cp310-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 52.5 MB
- Tags: CPython 3.10+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd8c4ac0a53725dc0b699a8af043edb4992a83b64dd4ca316f475f899ce4b931
|
|
| MD5 |
53392200d45f70f1972ae6cec7151277
|
|
| BLAKE2b-256 |
758c04a6381a7f38da29ad31a5d91801274beda8e6c40196c2bd9826cbfbdb84
|