2.10 - SHOW Syntax for the Presto Connector - Teradata QueryGrid

Teradata® QueryGrid™ Installation and User Guide

prodname
Teradata QueryGrid
vrm_release
2.10
created_date
September 2019
category
Administration
Configuration
Installation
User Guide
featnum
B035-5991-099K
The Presto SHOW statement provides the details of schemas/databases, tables, and table columns on local or remote systems. The SHOW CATALOGS statement lists the contents of the Presto catalog. The following statements are available:
  • SHOW SCHEMAS FROM <catalog_name>;
  • SHOW TABLES FROM <catalog_name>.<schemaname>;
  • SHOW COLUMNS FROM <catalog_name>.<schemaname>.<tablename>;
  • SHOW CATALOGS;
  • DESCRIBE <catalog_name>.<schema_name>.<tablename>;

The Presto DESCRIBE statement is an alias for the Presto SHOW COLUMNS statement and returns the same information.

The Presto SHOW statement is equivalent to the HELP FOREIGN statement used when Teradata is the initiator. For more information, see Examples of Using HELP FOREIGN.

Example: Presto to Teradata SHOW SCHEMAS

The example fetches the schema (databases) from the remote Teradata system. QD_TD1 is the catalog used to reference the Presto-to-Teradata link.

presto:default> SHOW SCHEMAS FROM QG_TD1;

Example: Presto to Teradata SHOW TABLES

The example fetches the list of tables from the specified database (<schemaname>) on the remote Teradata system.

presto:default> SHOW TABLES FROM QG_TD1.<schemaname>;

Example: Presto to Teradata SHOW COLUMNS

The example fetches the column information from the specified table (<schemaname>.<tablename>) on the remote Teradata system.

presto:default> SHOW COLUMNS FROM QG_TD1.<schemaname>.<tablename>;
The Presto DESCRIBE <catalog_name>.<schema_name>.<tablename> statement can be used instead of SHOW COLUMNS.

Example: Presto SHOW CATALOGS

The example lists the registered catalogs. It does not invoke a Teradata QueryGrid query.

presto:default> SHOW CATALOGS;

Result:

   Catalog
----------------
 hive
 qginitiator
 qgremote
 system
 QG_TD1
 tpch
The Presto-to-Teradata catalog called QG_TD1 is listed as well as the rest of the registered catalogs.