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.4.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.4.0
File Size Uploaded
pypaimon_rust-0.4.0.tar.gz 2.9 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for pypaimon-rust 0.4.0
File
pypaimon_rust-0.4.0-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
pypaimon_rust-0.4.0-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details
pypaimon_rust-0.4.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.4.0-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
pypaimon_rust-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 395.3 MB

Release files / pypaimon_rust-0.4.0.tar.gz

Download URL pypaimon_rust-0.4.0.tar.gz
Size 2.9 MB
Tags Source
SHA-256 checksum
How to use checksums
a55b29fc4aac9c90f40c280878ad19dfbdbfcd87dea8beb5b66e01e630f5f4d8
BLAKE2b-256 checksum
How to use checksums
88a04e6e67ac8453490cd6552530b6541b0ff8464040de3d859ed1449627f665
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL pypaimon_rust-0.4.0-cp310-abi3-win_amd64.whl
Size 73.3 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
50846a54fcaab5e3b43339a34b5d26247eebc462381904b705b969ed8f5772f6
BLAKE2b-256 checksum
How to use checksums
51dfe644966a2d45583527b12a2c89c52e5905b678776aa4fc81797eb594fb34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL pypaimon_rust-0.4.0-cp310-abi3-manylinux_2_28_aarch64.whl
Size 85.8 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
8fb09e9be558e1208dc1f7b219427de7ca3946578ad3276a340d4b8f67beb104
BLAKE2b-256 checksum
How to use checksums
c4d1fdf3e241d3c19230814726fc3d8a32d2ef46b3df1f105065522abbc7ded5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL pypaimon_rust-0.4.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 83.2 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
f8113ba278da4a29ca510e394ffff043b1e90e1ed3d62478f9ad51042c49f01d
BLAKE2b-256 checksum
How to use checksums
e3366defefb5221d0e128a6132f82c92bf105c5cea7716db8961bfde538c1299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL pypaimon_rust-0.4.0-cp310-abi3-macosx_11_0_arm64.whl
Size 73.2 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
8f3aa530a0318d8d9a673b6e5124e1b14837f2232620c13cecb7f85542df3000
BLAKE2b-256 checksum
How to use checksums
cae759a4855d93b3da16a6f156e682c0b34992e48e3eab9233666e7c5c8a5b6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

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

Download URL pypaimon_rust-0.4.0-cp310-abi3-macosx_10_12_x86_64.whl
Size 76.8 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
9769e4bbffbb8309cc984f38ce899afbd7ca7cc1f60b1fa2c25bbf312fbff0c5
BLAKE2b-256 checksum
How to use checksums
b13fea936a0e7f5ff96fb1e47816acf3aa882a3e7b272c5459c34703d00d55eb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

This release

0.4.0 This release

6 release files

0.3.0

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