System Tables
Paimon allows you to access system tables to obtain detailed information, such as the snapshots, schemas, and options. System tables are identified by appending a dollar sign ($) and the metadata table name to the original table name. In some cases, the table name needs to be enclosed with back quotes to avoid syntax parsing conflicts.
SELECT * FROM my_catalog.my_db.`my_table$snapshots`
| System Table Name (Suffix) | Function Description | Example |
|---|---|---|
| $snapshots | Queries the snapshot history of a table, including the snapshot ID, commit time, and record count occurred in the snapshot. It is used to understand commit and expiration information about that table and supports data time travel. | SELECT * FROM my_table$snapshots; |
| $schemas | Queries the historical schemas of the table to track structural changes over time. | SELECT * FROM my_table$schemas; |
| $options | Queries the table options specified by DDL. Options that are not displayed will use their default values. | SELECT * FROM my_table$options; |
| $audit_log | Queries the changelogs of the table. Through this table, you can get the rowkind column (+I, -U, +U, and -D) for filtering and auditing operations. | SELECT * FROM my_table$audit_log; |
| $ro | Read-optimized table. Only files that do not require merging are scanned. The read data may not be the latest, but the read performance is higher. | SELECT * FROM my_table$ro; |
| $files | Queries file details for a specific snapshot, including partition, bucket, file path, record count, size, and key-value range. | SELECT * FROM my_table$files; |
| $tags | Queries the tag history of the table, including the snapshots based on which the tags are created and some snapshot history. You can time travel to specific tag data by tag name. | SELECT * FROM my_table$tags; |
| $consumers | Queries the next snapshot information consumed by all consumers. | SELECT * FROM my_table$consumers; |
| $manifests | Queries all manifest files contained in the latest or specified snapshot of the current table. | SELECT * FROM my_table$manifests; |
| $aggregation_fields | Queries the historical aggregation information of the table. | SELECT * FROM my_table$aggregation_fields; |
| $partitions | Queries the partition files of a table. | SELECT * FROM my_table$partitions; |
Global System Table
Global system tables contain the statistical and configuration information for all tables. You can access global system table through a reference system database called sys.
| System Table Name | Function Description | Example |
|---|---|---|
| sys.all_table_options | Similar to the Options Table, but shows all the table options in all databases. | SELECT * FROM sys.all_table_options; |
| sys.catalog_options | Queries the options of a catalog. Options that are not displayed will use their default values. | SELECT * FROM sys.catalog_options; |
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot