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.

Download files

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

Source Distribution

pypaimon_rust-0.3.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pypaimon_rust-0.3.0-cp310-abi3-win_amd64.whl (65.9 MB view details)

Uploaded CPython 3.10+Windows x86-64

pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl (78.3 MB view details)

Uploaded CPython 3.10+manylinux: glibc 2.28+ ARM64

pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (75.8 MB view details)

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

pypaimon_rust-0.3.0-cp310-abi3-macosx_11_0_arm64.whl (66.5 MB view details)

Uploaded CPython 3.10+macOS 11.0+ ARM64

pypaimon_rust-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl (69.6 MB view details)

Uploaded CPython 3.10+macOS 10.12+ x86-64

File details

Details for the file pypaimon_rust-0.3.0.tar.gz.

File metadata

  • Download URL: pypaimon_rust-0.3.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pypaimon_rust-0.3.0.tar.gz
Algorithm Hash digest
SHA256 11f1794257b1c2cc4e88a67163e76c08de7a82b70efe04800a97f30e8404d47a
MD5 8307197c167609738cd919eb8d6e902d
BLAKE2b-256 5c0db737c61bbe04777761600b47ccfbfeaaa6c4246c74d6ad3a90a641b30fdc

See more details on using hashes here.

File details

Details for the file pypaimon_rust-0.3.0-cp310-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for pypaimon_rust-0.3.0-cp310-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 7bfd2808039f53aa57b820a0e05622bc1a6a4366503a8e271cc793f2ea691598
MD5 314db9de38c276b7c6c7423c9e8b85d2
BLAKE2b-256 9b9e4c8544d25db563f5652b3c2d6778a0b964c98d9c27c3b6d9dd0b68399f74

See more details on using hashes here.

File details

Details for the file pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2090800d042a4718bfa2dd2542d1ccc3e08f28e4f6a48edb714db7e5cb02dc1d
MD5 768e4391454c84096376a23759bc58f5
BLAKE2b-256 c19d3d32b9e892ab782476ebba70ad0dc1bad9f98a7ee7dfa189f6f2329314cf

See more details on using hashes here.

File details

Details for the file pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pypaimon_rust-0.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a6ba435dff7756e41bf7cd0a852defc9db3fed2d702bdd88375f2fb29c163f50
MD5 338226e808d23775fb7353fe73b32ccd
BLAKE2b-256 d849a126cebda67a56230873f5c7e13502b47461f61b517bd4e3bbafe1e879e2

See more details on using hashes here.

File details

Details for the file pypaimon_rust-0.3.0-cp310-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pypaimon_rust-0.3.0-cp310-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ca863a08fc4930aab70ea0c3135f43a80bd52d3a13a44f3e7258d1340aa8c5c1
MD5 b7c6015a87b1909c968d17b2b96474e0
BLAKE2b-256 c0c8764b2e6624f30186e594a3482ddcc240fbd69eafbd817734ab5a1226aea8

See more details on using hashes here.

File details

Details for the file pypaimon_rust-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pypaimon_rust-0.3.0-cp310-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 4f0acd307d8b5e8c4accbf3461963cae9b66dd52f5b8e4a9ad8f99cc52a926e2
MD5 77cb89c918c31fa997ff4d1ebf8627dd
BLAKE2b-256 c01dca2b5941923053521727e39249a754fc60920bace24e51477d8f45960138

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page