DESCRIBE RELATION COLUMNS

Syntax

DESCRIBE [ RELATION | STREAM | CHANGELOG | MATERIALIZED VIEW ]
COLUMNS fully_qualified_relation_name;

Description

Arguments

fully_qualified_relation_name

This is the name of the Relation to describe its columns. For case-sensitive names, the name must be wrapped in double quotes; otherwise, the lowercase name will be used.

The Relation name may optionally be fully qualified in the format of <database_name>.<schema_name>.<relation_name> or <schema_name>.<relation_name>. If the Database or Schema name is not provided, then the current session's Database or Schema will be used (see USE).

Examples

Describe a Stream's columns

demodb.public/demostore# DESCRIBE RELATION COLUMNS pageviews;
+----------+---------+-----------+-------------+
|  Name    |  Type   |  Nullable |  Properties |
+==========+=========+===========+=============+
| viewtime | BIGINT  | true      | {}          |
+----------+---------+-----------+-------------+
| userid   | VARCHAR | true      | {}          |
+----------+---------+-----------+-------------+
| pageid   | VARCHAR | true      | {}          |
+----------+---------+-----------+-------------+

Describe a Stream's columns in a specific Database/Schema

demodb.public/demostore# DESCRIBE RELATION COLUMNS pageviews;
+----------+---------+-----------+-------------+
|  Name    |  Type   |  Nullable |  Properties |
+==========+=========+===========+=============+
| viewtime | BIGINT  | true      | {}          |
+----------+---------+-----------+-------------+
| userid   | VARCHAR | true      | {}          |
+----------+---------+-----------+-------------+
| pageid   | VARCHAR | true      | {}          |
+----------+---------+-----------+-------------+

Describe a Materialized View's columns

The following describes the columns for pvcount in the demodb Databae and public Schema:

demodb.public/demostore# DESCRIBE MATERIALIZED VIEW COLUMNS demodb."public".pvcount;
+-------------+---------+-----------+-------------+
|  Name       |  Type   |  Nullable |  Properties |
+=============+=========+===========+=============+
| page_name   | VARCHAR | true      | {}          |
+-------------+---------+-----------+-------------+
| pageid      | VARCHAR | true      | {}          |
+-------------+---------+-----------+-------------+
| cnt         | BIGINT  | false     | {}          |
+-------------+---------+-----------+-------------+

Describe a Changelog

demodb.public/demostore# DESCRIBE CHANGELOG COLUMNS users_log;
+--------------+-----------------------+-----------+-------------+
|  Name        |  Type                 |  Nullable |  Properties |
+==============+=======================+===========+=============+
| registertime | BIGINT                | true      | {}          |
+--------------+-----------------------+-----------+-------------+
| userid       | VARCHAR               | true      | {}          |
+--------------+-----------------------+-----------+-------------+
| regionid     | VARCHAR               | true      | {}          |
+--------------+-----------------------+-----------+-------------+
| gender       | VARCHAR               | true      | {}          |
+--------------+-----------------------+-----------+-------------+
| interests    | ARRAY<VARCHAR>        | true      | {}          |
+--------------+-----------------------+-----------+-------------+
| contactinfo  | STRUCT <phone VARCHAR | true      | {}          |
|              | , city VARCHAR,       |           |             |
|              | "state" VARCHAR, zip  |           |             |
|              | code VARCHAR>         |           |             |
+--------------+-----------------------+-----------+-------------+

Describe a Table's columns

demodb.public/demostore# DESCRIBE RELATION COLUMNS pv_agg;
+-----------+---------+-----------+-------------+
|  Name     |  Type   |  Nullable |  Properties |
+===========+=========+===========+=============+
| userid    | VARCHAR | true      | {}          |
+-----------+---------+-----------+-------------+
| pagecount | BIGINT  | true      | {}          |
+-----------+---------+-----------+-------------+

Describe a Relation's columns with a case-sensitive name

demodb.public/demostore# DESCRIBE RELATION "Pageviews";
+----------+---------+-----------+-------------+
|  Name    |  Type   |  Nullable |  Properties |
+==========+=========+===========+=============+
| viewtime | BIGINT  | true      | {}          |
+----------+---------+-----------+-------------+
| userid   | VARCHAR | true      | {}          |
+----------+---------+-----------+-------------+
| pageid   | VARCHAR | true      | {}          |
+----------+---------+-----------+-------------+

Last updated