GlareDB

DESCRIBE

DESCRIBE statements provide information about the schema of queries, tables, table functions, or files.

Describing a Query

DESCRIBE followed by a query can be used to show the names and data types that would be returned by that query:

DESCRIBE SELECT 1 as a, 'hello' as b;

Shows the following query info:

column_namedatatype
aInt32
bUtf8

Describing Tables and Table Functions

DESCRIBE followed by a table, table function, or file shows the column names and data types of that object.

Describe my_table:

CREATE TEMP TABLE my_table (a TEXT, b DECIMAL(16, 2));
DESCRIBE my_table;

Outputs:

column_namedatatype
aUtf8
bDecimal64(16,2)

Describe the output of a call to a table function:

DESCRIBE unnest([4,5,6]);

Outputs:

column_namedatatype
unnestInt32