Cloud

DESCRIBE

The DESCRIBE statement displays columns of a table, lists tables in a database, or shows the configuration of a storage connection.

Syntax

DESCRIBE DATABASE;
DESCRIBE TABLE table_name;
DESCRIBE TABLE catalog_name=>table_name;
DESCRIBE REDPANDA CATALOG catalog_name;
DESCRIBE ICEBERG CATALOG catalog_name;
DESCRIBE STORAGE storage_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 (after REDPANDA CATALOG): Name of a Redpanda catalog. Lists the tables and topic mappings in that catalog.

  • catalog_name (after ICEBERG CATALOG): Name of an Iceberg catalog. Lists the catalog’s connection details, including its REST endpoint and warehouse.

  • storage_name (after STORAGE): Name of a storage connection. Displays its configuration.

This statement is available to all users with the USAGE privilege on the schema where the table is located.

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 public schema, the default in Redpanda SQL. For information on displaying tables from other schemas, see Schema.

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  |
+----------------+--------------+

Describe an Iceberg catalog

To list connection details for an Iceberg catalog, run:

DESCRIBE ICEBERG CATALOG lakehouse_catalog;

The query returns the catalog’s REST endpoint, warehouse, and authentication type. If flat_namespaces or allowed_namespaces are set on the catalog, those values are also shown.

Describe a storage connection

To view the type and configuration of a storage connection, run:

DESCRIBE STORAGE archive_storage;

The query returns:

+------------------+------+-------------+---------------------------+
| name             | type | schema_name | parameters                |
+------------------+------+-------------+---------------------------+
| archive_storage  | s3   | public      | {"region": "us-west-2"}   |
+------------------+------+-------------+---------------------------+