Trino
v0.8.2Query Trino and inspect or maintain Iceberg tables: catalogs, schemas, SQL, snapshots.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
show_catalogs Show Catalogs
List all available catalogs.
show_schemas Show Schemas
List all schemas in a catalog.
| Parameter | Type | Description |
|---|---|---|
catalog | Catalog name (defaults to TRINO_CATALOG) |
show_tables Show Tables
List all tables in a schema.
| Parameter | Type | Description |
|---|---|---|
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
describe_table Describe Table
Describe a table's columns and types (JSON).
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_create_table Show Create Table
Show the CREATE TABLE statement for a table.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_create_view Show Create View
Show the CREATE VIEW statement for a view.
| Parameter | Type | Description |
|---|---|---|
view * | string | View name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_stats Show Stats
Show column statistics for a table (JSON).
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_catalog_tree Show Catalog Tree
Show a hierarchical tree of all catalogs, schemas and tables. Can be slow on large installations.
show_query_history Show Query History
Show recently executed queries from system.runtime.queries, newest first (JSON).
| Parameter | Type | Description |
|---|---|---|
limit | Maximum number of entries to return |
execute_query Execute Query
Execute a SQL statement and return the rows as JSON. In read-only mode only SELECT, WITH, SHOW, DESCRIBE, EXPLAIN and VALUES statements are allowed.
| Parameter | Type | Description |
|---|---|---|
query * | string | The SQL statement to execute |
optimize Optimize
Compact small data files of an Iceberg table.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
optimize_manifests Optimize Manifests
Rewrite and compact the manifest files of an Iceberg table.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
expire_snapshots Expire Snapshots
Remove Iceberg snapshots older than the retention threshold.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
retention_threshold | string | Minimum snapshot age to remove, e.g. '7d' or '12h' |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_table_properties Show Table Properties
Show Iceberg table properties (JSON).
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_table_history Show Table History
Show Iceberg table history (JSON). Columns: made_current_at, snapshot_id, parent_id, is_current_ancestor.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_metadata_log_entries Show Metadata Log Entries
Show Iceberg metadata log entries (JSON). Columns: timestamp, file, latest_snapshot_id, latest_schema_id, latest_sequence_number.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_snapshots Show Snapshots
Show Iceberg table snapshots (JSON). Columns: committed_at, snapshot_id, parent_id, operation, manifest_list, summary.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_manifests Show Manifests
Show Iceberg manifest files (JSON). Columns: path, length, partition_spec_id, added_snapshot_id, added/existing/deleted data file and row counts, partition_summaries.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
all_snapshots | boolean | Include all snapshots instead of only the current one |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_partitions Show Partitions
Show Iceberg table partitions (JSON). Columns: partition, record_count, file_count, total_size, data (per-column min/max and null counts).
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_files Show Files
Show Iceberg data files in the current snapshot (JSON). Columns include content (0=DATA, 1=POSITION_DELETES, 2=EQUALITY_DELETES), file_path, file_format, record_count, file_size_in_bytes, column sizes/counts and lower/upper bounds.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_entries Show Entries
Show Iceberg manifest entries (JSON). Columns: status (0=EXISTING, 1=ADDED, 2=DELETED), snapshot_id, sequence_number, file_sequence_number, data_file, readable_metrics.
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
all_snapshots | boolean | Include all snapshots instead of only the current one |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |
show_refs Show Refs
Show Iceberg table references, i.e. branches and tags (JSON).
| Parameter | Type | Description |
|---|---|---|
table * | string | Table name |
catalog | Catalog name (defaults to TRINO_CATALOG) | |
schema_name | Schema name (defaults to TRINO_SCHEMA) |