You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "SML0127 (via GitHub)" <gi...@apache.org> on 2026/04/25 11:20:55 UTC

[I] Expose catalog metadata API (list_databases, list_tables, schema) for pypaimon_rust [paimon-rust]

SML0127 opened a new issue, #284:
URL: https://github.com/apache/paimon-rust/issues/284

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/paimon-rust/issues) and found nothing similar.
   
   
   ### Motivation
   
   Paimon-rust's python bindings (path: bindings/python) currently expose only a DataFusion entry point:
   
   ```python
   catalog = PaimonCatalog({"metastore": "filesystem", "warehouse": "..."})
   ctx = SessionContext()
   ctx.register_catalog("paimon", catalog)  # only access path
   ctx.sql("SELECT * FROM paimon.mydb.orders")
   ```
   
   This makes it impossible to use paimon-rust as a drop-in replacement for pypaimon in metadata-browsing and schema-introspection use cases. The following operations that pypaimon supports today are entirely missing:
   
   - Listing databases and tables
   - Fetching table schema (columns, types, primary keys, partition keys, table options)
   
   
   ### Solution
   
   Add the following methods to PaimonCatalog and introduce three new wrapper classes:
   
   ```python
   # PaimonCatalog (additions)
   catalog.list_databases() -> list[str]
   catalog.list_tables(database_name: str) -> list[str]
   catalog.get_table(identifier: str) -> PyTable        # "db.table" format
   
   # PyTable (new)
   table.identifier() -> str
   table.location()   -> str
   table.schema()     -> PyTableSchema
   
   # PyTableSchema (new)
   schema.fields()         -> list[PyDataField]
   schema.partition_keys() -> list[str]
   schema.primary_keys()   -> list[str]
   schema.options()        -> dict[str, str]            # e.g. bucket, changelog-mode
   schema.comment()        -> str | None
   
   # PyDataField (new)
   field.name()        -> str
   field.field_type()  -> str                           # e.g. "INT NOT NULL", "TIMESTAMP(6)"
   field.is_nullable() -> bool
   field.description() -> str | None
   ```
   
   Intended usage (parity with pypaimon):
   ```python
   catalog = PaimonCatalog({"metastore": "filesystem", "warehouse": "/tmp/paimon"})
   
   for db in catalog.list_databases():
       for tbl in catalog.list_tables(db):
           table  = catalog.get_table(f"{db}.{tbl}")
           schema = table.schema()
           print(schema.fields(), schema.primary_keys(), schema.options())
   ```
   
   ### Anything else?
   
   _No response_
   
   ### Willingness to contribute
   
   - [ ] I'm willing to submit a PR!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Expose catalog metadata API (list_databases, list_tables, schema) for pypaimon_rust [paimon-rust]

Posted by "JingsongLi (via GitHub)" <gi...@apache.org>.
JingsongLi closed issue #284: Expose catalog metadata API (list_databases, list_tables, schema) for pypaimon_rust
URL: https://github.com/apache/paimon-rust/issues/284


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@paimon.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org