DESCRIBE

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

Syntax

DESCRIBE query_or_table

Parameters

  • query_or_table: A query or table-like object.

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

Describing Files

DESCRIBE can only be used to describe local and remote files.

For example, we can describe a parquet file located in S3:

DESCRIBE 's3://glaredb-public/userdata0.parquet';

Which will output the following:

column_namedatatype
registration_dttmTimestamp(ns)
idInt32
first_nameUtf8
last_nameUtf8
emailUtf8
genderUtf8
ip_addressUtf8
ccUtf8
countryUtf8
birthdateUtf8
salaryFloat64
titleUtf8
commentsUtf8