DESCRIBE
The DESCRIBE statement displays columns of a table or lists tables in a database.
Syntax
DESCRIBE DATABASE;
DESCRIBE TABLE table_name;
DESCRIBE TABLE catalog_name=>table_name;
DESCRIBE REDPANDA CATALOG catalog_name;
DESCRIBE ICEBERG CATALOG catalog_name;
-
table_name: Name of the table to describe. -
catalog_name⇒table_name: Describes a table that is mapped to a Redpanda topic through a catalog. -
catalog_name(afterREDPANDA CATALOG): Name of a Redpanda catalog. Lists the tables and topic mappings in that catalog. -
catalog_name(afterICEBERG CATALOG): Name of an Iceberg catalog. Lists the catalog’s connection details, including its REST endpoint and warehouse.
|
This statement is available to all users with the |
Examples
Describe a table
To show the columns of the part table, run the query:
DESCRIBE TABLE part;
The query returns:
+----------------+------------+-------------+-------+----------+
| database_name | table_name | name | type | nullable |
+----------------+------------+-------------+-------+----------+
| public | part | p_partkey | INT | f |
| public | part | p_name | TEXT | f |
| public | part | p_mfgr | TEXT | f |
| public | part | p_category | TEXT | f |
| public | part | p_brand | TEXT | f |
| public | part | p_color | TEXT | f |
| public | part | p_type | TEXT | f |
| public | part | p_size | INT | f |
| public | part | p_container | TEXT | f |
+----------------+------------+-------------+-------+----------+
|
Tables in this example use the |
Describe a database
To list all tables in the database, run:
DESCRIBE DATABASE;
The query returns:
+-----------------------------+
| name |
+-----------------------------+
| supplier_scale_1_no_index |
| features |
| orders |
| features2 |
| featurestable |
| featurestable1 |
| featurestable10 |
+-----------------------------+
Describe a catalog table
To view column details for a table mapped through a Redpanda catalog, run:
DESCRIBE TABLE default_redpanda_catalog=>transactions;
The query returns:
+---------------------------+--------------+-------------+-------+----------+
| database_name | table_name | name | type | nullable |
+---------------------------+--------------+-------------+-------+----------+
| default_redpanda_catalog | transactions | tx_id | INT | f |
| default_redpanda_catalog | transactions | amount | REAL | f |
| default_redpanda_catalog | transactions | created_at | TEXT | f |
+---------------------------+--------------+-------------+-------+----------+
Describe a Redpanda catalog
To list the tables and topic mappings in a Redpanda catalog, run:
DESCRIBE REDPANDA CATALOG default_redpanda_catalog;
The query returns:
+----------------+--------------+
| table_name | topic_name |
+----------------+--------------+
| transactions | transactions |
| user_events | user-events |
+----------------+--------------+