Skip to main content

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")

Multimodal SQL Helpers

SQLContext also registers Python scalar UDFs for common BLOB media and vector workflows. Install the optional media dependencies when you need image or video decoding:

pip install "pypaimon-rust[video]"
batches = ctx.sql("""
    SELECT
        id,
        media_info(content) AS info_json,
        media_thumbnail(content, 160, 90) AS preview_png,
        video_snapshot(content, 1000) AS frame_png
    FROM paimon.my_db.assets
""")

For vector search, vector_from_json converts JSON-encoded embeddings into Arrow List<Float32> values that can be used from a temporary table or subquery:

batches = ctx.sql("""
    WITH queries AS (
        SELECT id, vector_from_json(embedding_json) AS embedding
        FROM paimon.my_db.query_embeddings
    )
    SELECT q.id AS query_id, r.id AS result_id
    FROM queries q
    CROSS JOIN LATERAL vector_search(
        'paimon.my_db.items',
        'embedding',
        q.embedding,
        10
    ) AS r
""")

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.

Metadata

Release files for pypaimon-rust 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pypaimon-rust 0.3.0
File Size Uploaded
pypaimon_rust-0.3.0.tar.gz 1.5 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pypaimon-rust 0.3.0
File
pypaimon_rust-0.3.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
pypaimon_rust-0.3.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
pypaimon_rust-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 357.6 MB

Release files / pypaimon_rust-0.3.0.tar.gz

Download URL pypaimon_rust-0.3.0.tar.gz
Size 1.5 MB
Tags Source
SHA-256 checksum
How to use checksums
11f1794257b1c2cc4e88a67163e76c08de7a82b70efe04800a97f30e8404d47a
BLAKE2b-256 checksum
How to use checksums
5c0db737c61bbe04777761600b47ccfbfeaaa6c4246c74d6ad3a90a641b30fdc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pypaimon_rust-0.3.0-cp310-abi3-win_amd64.whl

Download URL pypaimon_rust-0.3.0-cp310-abi3-win_amd64.whl
Size 65.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7bfd2808039f53aa57b820a0e05622bc1a6a4366503a8e271cc793f2ea691598
BLAKE2b-256 checksum
How to use checksums
9b9e4c8544d25db563f5652b3c2d6778a0b964c98d9c27c3b6d9dd0b68399f74
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl
Size 78.3 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
2090800d042a4718bfa2dd2542d1ccc3e08f28e4f6a48edb714db7e5cb02dc1d
BLAKE2b-256 checksum
How to use checksums
c19d3d32b9e892ab782476ebba70ad0dc1bad9f98a7ee7dfa189f6f2329314cf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 75.8 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
a6ba435dff7756e41bf7cd0a852defc9db3fed2d702bdd88375f2fb29c163f50
BLAKE2b-256 checksum
How to use checksums
d849a126cebda67a56230873f5c7e13502b47461f61b517bd4e3bbafe1e879e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pypaimon_rust-0.3.0-cp310-abi3-macosx_11_0_arm64.whl

Download URL pypaimon_rust-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Size 66.5 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ca863a08fc4930aab70ea0c3135f43a80bd52d3a13a44f3e7258d1340aa8c5c1
BLAKE2b-256 checksum
How to use checksums
c0c8764b2e6624f30186e594a3482ddcc240fbd69eafbd817734ab5a1226aea8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / pypaimon_rust-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl

Download URL pypaimon_rust-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 69.6 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4f0acd307d8b5e8c4accbf3461963cae9b66dd52f5b8e4a9ad8f99cc52a926e2
BLAKE2b-256 checksum
How to use checksums
c01dca2b5941923053521727e39249a754fc60920bace24e51477d8f45960138
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.3.0 This release

6 release files

0.2.0

6 release files

0.1.0

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page