Chalk SQL
Inspect the schema of a table or query and discover objects available to Chalk SQL.
Use DESCRIBE to inspect the columns of a table or query. Use SHOW to
discover objects available to Chalk SQL.
-- Describe a data source table
DESCRIBE "my_postgres.public.users";
-- Describe the output schema of a query without running it over all data
DESCRIBE
SELECT
user_id,
sum(amount) AS total
FROM
"my_bigquery.my_dataset.transactions"
GROUP BY
user_id;
-- List all available tables
SHOW TABLES;DESCRIBE {< table_name > | < select_statement >};
SHOW < table_name >;
SHOW COLUMNS
FROM
< table_name >;All three forms return one row per column. To inspect a table whose name is a
SHOW listing keyword, use DESCRIBE or quote the name, for example SHOW "functions".
| Column | Type | Description |
|---|---|---|
column_name | string | The name of the column |
column_type | string | The data type of the column |
null | string | YES if the column is nullable, NO otherwise |
key | string | Always NULL |
default | string | Always NULL |
extra | string | Always NULL |
DESCRIBE is compiled as a table expression, so it can also be used in the
FROM clause of a SELECT:
SELECT
column_name
FROM
(DESCRIBE "my_postgres.public.users")
WHERE
column_type = 'string';SHOW CATALOGS;
SHOW SCHEMAS [ FROM <catalog> ];Run SHOW CATALOGS to find catalog names. Use SHOW SCHEMAS FROM <catalog> to
list the schemas in one of those catalogs. SHOW SCHEMAS lists schemas across
available catalogs.
SHOW TABLES [ FROM <scope> ];Use FROM <scope> to limit the listing to a catalog, a schema, or a qualified
catalog.schema name. A single name resolves to a catalog first, then to a schema.
Without FROM, the statement lists the tables visible to Chalk SQL, as does
this query:
SELECT
*
FROM
"chalk.information_schema.tables";SHOW FUNCTIONS;
SHOW MODELS;
SHOW COMPUTE_FUNCTIONS;SHOW FUNCTIONS lists SQL functions, including deployed compute functions.
SHOW MODELS and SHOW COMPUTE_FUNCTIONS list deployed entries with their
qualified names and output types. Use the
Chalk information schema to filter or
join these listings.
SHOW JOBS;On the native SQL server, SHOW JOBS returns the schedules available through
chalk.jobs.
See Chalk SQL jobs for the commands that manage them.
SHOW CATALOGS to list available catalogs.SUMMARIZE is not supported.